Jump to content

benanamen

Members
  • Content Count

    1,799
  • Joined

  • Last visited

  • Days Won

    33

Everything posted by benanamen

  1. benanamen

    Best approach guidance

    Your asking about the most basics of HTML now. Your going to have to put in at least a little effort. Are you telling us you can create a database but you do not know how to make a form or what the syntax is for check boxes?
  2. benanamen

    Best approach guidance

    Your best option is to use PDO to work with the database. Here is a good tutorial to get you going. Forms are pretty basic so I wont get into how to create a form.
  3. benanamen

    Best approach guidance

    I would suggest you take this a step at a time. Start with the database. When you have the DB done, show us what you did and we will review it and guide you to any changes/improvements. After you implement the final DB design then we can move to the next step. You already have the overall summary of the project which was the first step. * Just a heads up. You would not have an "age" column. You would store the birth date and calculate the age from that.
  4. Your code smells of a bad database design. How about telling us why you are repeating the same data columns in multiple tables.
  5. benanamen

    Get specific MySQL/MariaDB error info

    I don't understand what you are looking for. What "content" do you want? Are you asking how to handle the error? If so, you can try/catch the error and respond the way you want. From the manual Source: http://php.net/manual/en/pdo.errorcode.php
  6. benanamen

    Get specific MySQL/MariaDB error info

    The error message could not be any more clear. You are attempting to insert/update/delete a column with a duplicate constraint with data that is already in the DB and incorrectly messing with data in a parent table that has child data.
  7. Could you please provide more information about this, as this is the "real" problem. You have been asking for help with your attempted solution to this. Let us decide what the solution should be. To properly do that we need to know all about the above.
  8. benanamen

    Insert Array values into mysql database

    When you when you start using incrementing numbers for your column names it is a big red flag to a design problem. Take a minute and learn about database normalization.
  9. benanamen

    Purchased Script - Help understanding file

    OP, you are incorrect. That is incorrect. It is the other way around .
  10. benanamen

    upgrade to PHP 5.5, Site Doesn't work

    That is not real code. Perhaps the manual will be of help. You will have to break it to your client that his "upgrade" is still hundreds and hundreds of releases behind. The whole bit of the code you posted shows there is quite a bit of work that will need to be done to bring the app up to date. Version 5.5 reached end of life many years ago. http://php.net/manual/en/mysqli.query.php
  11. benanamen

    Sql to loop through table

    The process can easily be automated. Allow me to introduce you to ETL, Extract, Transform, Load. There are many software's both free and paid for this purpose. https://en.wikipedia.org/wiki/Extract,_transform,_load
  12. For those of you that have not gotten the word, GitHub now offers FREE repository’s as of today.
  13. benanamen

    $row['index here'] outputs null

    Stop creating variables for nothing and use Prepared Statements. Never ever put user supplied variables in your query.
  14. benanamen

    Data is not inserted into db

    Now you tell me! It was an SUV that hit me.
  15. benanamen

    Data is not inserted into db

    Oh my. I have been really off my game lately. I got hit by a car this past November and got a concussion. It has been showing in many of my posts . Thanks @Barand.
  16. benanamen

    Data is not inserted into db

    Ok, I missed it. 😬 The !isset logic is wrong. The $_FILES['userfile'] is always going to be set on POST so that block will never run. You need to check if the userfile name is empty like so... if (empty($_FILES['userfile']['name'])) { Run this with no upload <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (empty($_FILES['userfile']['name'])) { echo 'No File Uploaded'; } if (!isset($_FILES['userfile'])) { echo 'I will never run'; } } ?> <html> <body> <form action="" method="POST" enctype="multipart/form-data"> <input type="file" name="userfile" /> <br> Username: <br> <input type="text" name="username" maxlength="26" placeholder="Username"> <input type="submit"/> </form> </body> </html>
  17. benanamen

    Data is not inserted into db

    By the way, username in the WHERE should not be quoted. I don't used named parameters but that may be the problem.
  18. benanamen

    Data is not inserted into db

    What is the result of var_dump($_FILES); Post your form as well.
  19. benanamen

    Data is not inserted into db

    What would be more helpful is an explanation of what " not working " means.
  20. benanamen

    Data is not inserted into db

    For starters, you have thrown a function right in the middle of where code should be processed. If you moved the function somewhere else you are now faced with a missing closing curly bracket and a call to the function floating in space. Start with NOT having all your code in a function. Saying something "is not working" is not going to help anyone help you. You would do well to read through this page.
  21. That would be the user_id that you should have in the table. This is most commonly an auto-increment column.
  22. benanamen

    PHP Login Form by using PDO connection

    This tutorial should get you on your way with PDO.
  23. The form submitted for me.
  24. benanamen

    Table form input to output to 2nd page table

    Why are you creating a session that you never use?
  25. benanamen

    What is wrong with this line?

    The result is an array. You cant echo an array. Do this.... echo '<pre>', print_r($user, true), '</pre>';
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.