Hi everyone,
I'm trying to write some PHP code to update a user's password. It is not updating and I can't spot what's wrong with my query (I have echo'ed it to the screen).

$sql="UPDATE $tbl_name set 'password'='$new_password' WHERE 'user'=$user;";

SQL statement

UPDATE user set 'password'='2' WHERE 'user'=test;

What's wrong?

you are doing it in reverse order, following is the correct version

$sql="UPDATE $tbl_name set password='$new_password' WHERE user='$user'";