Hi!

I am using the following SQL query to update a record. Now the problem i am getting is that its updating all records in the database weather information matches or not, why this is happening ?

PHP Code:
// Update account status depending upon the ID & Code
$sql1 "UPDATE users SET isactive = 'Y' WHERE id = '" $id "' AND code = '" $code "'";
$result = (mysql_query($sql1)) or die(mysql_error()); 
The id contains the user id like 1 and the code contains a number like 123456789. So each record has a different id and a different code. But it updates all records and does not cares about the information i provide to it.

Please help!

Thanks!