0
I’m having trouble correcting this error, I don’t know much about language (almost anything). The error that appears on the page is this:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\core\inc\user.inc.php on line 10
PHP:
<?php
function validate_credentials($user_name, $user_password){
$user_name = mysql_real_escape_string($user_name);
$user_password = sha1($user_password);
$result = mysql_query("SELECT `user_id` FROM `users` WHERE `user_name` =
'{$user_name}' AND `user_password` = '{$user_password}'");
if (mysql_num_rows($result) != 1){
return false;
}
return mysql_result($result, 0);
}
?>