HI all,
Suddenly my website is no longer working....Particularly something related with mysql_num_rows and mysql_fetch_array.
I did not change my codes relating to those portions. I even revert back to old versions of working codes still cannot.
Repair database and reinstall my sql also cannot.
Tried on a new OS with everyting on a new partition....also cannot.
Any kind soul seen this wierd problem can help me please...
millions of thanks.
Error >>
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in l:\inetpub\wwwroot\lms3\check_login.php on line 53
My code correct right?>>
function login($userid ,$password, &$usertype){
$query = "SELECT * FROM emp_details WHERE (emp_id = '$userid') AND (passwd = '$password') AND (emp_status = 'A')";
$result = db_call($query);
$match = mysql_fetch_array($result);
//comment to test still the same....
//$match = mysql_num_rows($result);
$usertype = stripslashes($match["context"]);
if(!$result)
return 0;
if(mysql_num_rows($result)>0)
return 1;
else
return 0;
mysql_close();
}
Why like that????