By single quote encapsulating the variables $username and $password, php treats them as literal strings. Try using periods to concatenate the variables into the statement like this: "SELECT * FROM member WHERE username='". $username. "' AND password = '". $password. "'" Gentlemike2 -----Original Message----- From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx]On Behalf Of Gab Teo Sent: Wednesday, April 28, 2010 3:06 PM To: php-objects@xxxxxxxxxxxxxxx Subject: supplied argument is not a valid Hello everyone, I loaded a server for a client and I am getting the below error. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/fineart/public_html/login.php on line 169 This is the line of the error $login=mysql_query("SELECT * FROM member WHERE username='$username' AND password='$password' "); //line 168 if(mysql_num_rows($login)==0) //line 169 Thanks, Gab [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]