Wednesday, May 2, 2012

MySql query error near WHERE

My code is



$user_query = '
UPDATE
users
SET
`password`="$password",
`email`="$email",
`position`="$position",
WHERE
`username`=".$uname."';
$user_result = mysql_query($user_query, $connection);
confirm_query($user_result);


When I run this query it gives me a error saying



Database query failed: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near
'WHERE `username`=".$uname."' at line 7


Can any body help me on this error. thank you everyone.?





No comments:

Post a Comment