Saturday, 22 July 2017

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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...