Sunday, 21 August 2016

php - Data not being written to sql database?





So i have set up a php script as outlined here :http://mmtuts.net/course.php?c=php&l=44 (this has all the files and the video).



When i sumbit the form I still get success from:




            $sql = "INSERT INTO users (user_first, user_last, user_email, user_uid, user_pwd) VALUES ('$first', '$last', '$email', '$uid', '$hashedPwd');";
mysqli_query($conn, $sql);
header("Location: ../signup.php?signup=success");


However, when i go to the sql database, there is nothing recorded?



I am using an online server through godaddy hosting.




enter image description here



I can manually add to the database:



enter image description here


Answer



Your using an uppercase table name USERS, but your query is using lowercase users.



You should rename the table to lowercase.


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...