I'm using this code to verify users from a form:

Code:
<?
session_start();
$login_result = mysql_query("SELECT * FROM members WHERE userid='$login_userid' AND userpass='$login_userpass'"); 
if (mysql_num_rows($login_result)==1) { 
$logged_in = "yes";
$logged_in_user = $login_userid;
$logged_in_pass = $login_userpass;
session_register('logged_in');
session_register('logged_in_user');
session_register('logged_in_pass');
}
?>
When I try to login it gives me this error:

Warning: Supplied argument is not a valid MySQL result resource in /home/super/public_html/phpnetwork/login.php on line 4

I can't figure out what's going on. Could someone help me out?