Warning: mysql_num_rows() expects parameter 1 to be resource [closed]

pattShopay

New Member
\[quote\] Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select \[/quote\]I am getting this warning: \[quote\] Warning: mysql_num_rows() expects parameter 1 to be resource\[/quote\]On this script: \[code\]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 } } ?> \[/code\]My code otherwise works but is the warning somehow hideable? It appears right in middle of my website -_-
 
Back
Top