Hello.
I need help on this one. Anyone knows why i keep on getting this error:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\hoya\checkLogin.php on line 16
And what should i modify with the codes i have here in order for it to work?
<?php
$username = $_POST["username"];
$password = $_POST["password"];
$con = mysql_connect("localhost","root","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
mysql_select_db("mydb", $con);
$result = mysql_query("SELECT * FROM sign-up WHERE Username='$username' AND Password='$password'");
$count = mysql_num_rows($result);
if($count==1)
header( 'Location: loggedIn.php' ) ;
else if($count == 0)
{echo "Wrong Username or Password!";}
mysql_close($con);
?>