Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\html\Login\checklogin.php on line 23
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2973202/mysql-fetch-array-expects-parameter-1-to-be-resource-boolean-given-in-select">mysql_fetch_array() expects parameter 1 to be resource, boolean given in select</a>  </p>
</blockquote>



<p>Hello im trying to get my login system going and i keep getting this error here is my code:</p>

<pre><code>&lt;?php
$host="localhost"; 
$username="root"; 
$password="power1"; 
$db_name="members"; 
$tbl_name="users"; 

$link  = mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$Email=$_POST['Email'];
$Password=$_POST['Password'];

$Email = stripslashes($Email);
$Password = stripslashes($Password);
$Email = mysql_real_escape_string($Email);
$Password = mysql_real_escape_string($Password);


$sql="SELECT * FROM $tbl_name WHERE Email='$Email' AND password ='$Password'";
$result=mysql_query($sql, $link) or die ('Unable to run query:'.mysql_error());


$count=mysql_num_rows($result);


if($count==1){
session_register("Email");
session_register("Password");
header("location:login_success.php");
}
else {
echo "Wrong Email or Password";
}
?&gt;
</code></pre>

<p>Its working now</p>
