Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\registration\login.php on line 19
is the error i get when i run the below code
i cant figure out what is wrong with it. :(
<?php
$username = $_POST ['username'];
$password = $_POST ['password'];
if ($username&&$password){
$connect = mysql_connect("localhost","root","") or die("Couldn't connect!");
mysql_select_db("phplogin") or die("Couldn't find db");
$query = mysql_query("SELECT * FROM users WHERE username='$username");
$numrows = mysql_num_rows($query);
echo $numrows;
}
else
die("Please enter a username and password");
?>