I am trying to create a login script and I use the following code to query the database:
$query = "SELECT * FROM customers WHERE username='$username' AND userpass= '$password'";
$result = mysql_query($query);
$rows = mysql_num_rows($result);
But I always get the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
It's only the
$rows = mysql_num_rows($result);
line that casuses the error, what is wrong with that line?
Thanks