Getting UPDATE query to affect the MySQL DB
Posted: Tue Sep 01, 2009 1:27 pm
All my other queries seem to run fine. This one seems to run without any error, but it doesn't introduce any changes into the DB:
I'm populating my form with the existing DB info; I let the user (me, for now) change one or another field. When the form is now submitted, the update query is supposed to run. It seems to run--I get no error message. But the DB info is not updated.
What am I missing? (I took the password line out of the update query just in case I didn't have that syntax right, but it still doesn't run.)
Thanks.
Code: Select all
$stud_name = $_POST['stud_name'];
$stud_id = $_POST['stud_id'];
$password = $_POST['password'];
$email = $_POST['email'];
$username = $_POST['username'];
//submit changes to DB
$sqlSubmitChanges = "UPDATE tblStudent
SET stud_name ='$stud_name',
username = '$username',
email = '$email'
WHERE stud_id = '$studentID'";
$resSubmitChanges = mysqli_query($mysqli, $sqlSubmitChanges) or die(mysqli_error($mysqli));What am I missing? (I took the password line out of the update query just in case I didn't have that syntax right, but it still doesn't run.)
Thanks.