I have never done an UPDATE statement before. I did some looking on the Internet and came up with the code below . . . It connects to the db and thinks it has worked, but it deleted data rather than update/change it??
This is for my class final project. It is a form to update user information.
Oh, it did delete the data from the right userID. ;-]
As always - HELP would be appreciated!
if ($isValid == 1) {
$query3 = "update mycustomer
set Address1 = '$address',
Address2 = '$address2',
City = '$city',
State = '$state',
ZipCode = '$zip',
Email = '$email',
Phone = '$phone' where Customer_ID = '$custID'";
$query4 = "UPDATE authorized_users SET password = '$pass 1' WHERE userid = '$id' ";
if(!mysqli_query($db3, $query3)){
echo mysqli_error($db3);
}
if(!mysqli_query($db4, $query4)){
echo mysqli_error($db4);
}else{
echo "<font><b>Data added to the database</b></font><br>";
exit;