php private message system part 4
Posted: Tue Feb 11, 2014 10:21 pm
i keep getting this error whether my login is correct or wrong
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\private_message_system\core\inc\user.inc.php on line 10
regards
collie
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\private_message_system\core\inc\user.inc.php on line 10
<?php // checks a given username and password combination, returning the users id 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); } ?>if anymore code needed just ask
regards
collie