OK i have this code:
<?//admin
$host = 'localhost'; // Host name Normally 'LocalHost'
$user = 'root'; // MySQL login username
$pass = ''; // MySQL login password
$database = 'juliver'; // Database name
$table = 'admin'; // Members name
mysql_connect($host, $user, $pass);
mysql_select_db($database);
if (isset($_POST['acc']) && ($_POST['pass']))
{
$username = mysql_real_escape_string($_POST['acc']);
$password = hash('sha512', $_POST['pass']);
$result = mysql_query("SELECT * FROM admin WHERE username = '$username' AND password = '$password'");
if(mysql_num_rows($result))
{
// Login
echo "has been login";
}
else
{
// Invalid username/password
echo 'Error: Invalid username or password';
}
exit;
}
else
{
echo "not been set";
}
?>
and i got this error: “Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\mu2\admin.php on line 17
has been login”, can somebody around here, could help me to figure out what might the hell is that error please?.. thanks in advance
im open in any suggestions anyway.
Its simple your call to mysql_query fails, You can
echo mysql_error()right after it to see what the error is.