0

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;";
			$result=mysql_query($sql);

SQL statement

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

What's wrong?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by urtrivedi
0

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

$sql="UPDATE $tbl_name set password='$new_password' WHERE user='$user'";
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.