The second and third queries dont get implemented, even though the if statement is true. Can anybody see something wrong in the code?
try making a string first. $string = "UPDATE accounts SET password='$password' WHERE email='$email'"; mysql_query($string); and try to run the query in phpmyadmin to check if the query is ok. good luck
You should add some debug to your code to see what's going on; find out whats being returned in the row you are fetching, and check for errors in the 2 SQL commands that aren't being executed $fields = mysql_fetch_row($result); # whats been returned? print_r($fields); $email = $fields[1]; mysql_query("UPDATE accounts SET password='$password' WHERE email='$email'") or die(mysql_error()); mysql_query("DELETE * FROM newpassword WHERE code='$code'") or die(mysql_error()); PHP: