Vojta Vojta - 3 months ago 27
MySQL Question

Password update not working

can you please review my code? I'm stuck.$result is returning false from some reason and I cannot change user passwd in my database.
Thank you in advance

  • connection is working, doublechecked

  • table users does exist, the same with column password and email

PHP code is

$sql ="UPDATE users". "SET password = $new_pwd "."WHERE email = $email";
$result= mysqli_query($connection,$sql);


Try enclosing the string vars in quotes

$sql ="UPDATE users  SET password = '$new_pwd' WHERE email = '$email';";

and remove unuseful string concat