Possible Duplicate:
mysql_num_rows(): supplied argument is not a valid MySQL result resource
I am using simple self-created php script to change password to my wow server's website.
Here's the error:  
"Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in D:\wamp\www\password.php on line 24"
Password script:
if (isset($_POST['submit'])){  
 change_db($realm_DB);  
 $loginusername = "$acc_name";  
 $loginpass = $_POST['password'];  
 $sha_pass_hash = sha1(strtoupper($loginusername) . ":" . strtoupper($loginpass));  
 $qry=mysql_query("UPDATE `$realm_DB`.`account` SET `sha_pass_hash`='$sha_pass_hash', `v`='', `s`='', WHERE (`username`='$loginusername');");  
 if (mysql_num_rows($qry) == 1){  
?>  
  < script type="text/javascript" >  
  {  
   alert("Successfully changed password!");  
  }  
  < /script>  
< ?php  
}  
}  
?> 
I added spaces to script type javascript and php tag just because you could see it.
Anyway I added "or trigger_error(mysql_error().$sql)" after "$qry" to see the sql error.
Here it is:  
"Notice: 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='ADMIN')' at line 1 in D:\wamp\www\password.php on line 23"
I don't know what causes those errors because I can register and login to my site.
Gief a help!
 
     
     
     
    