Newbie question with Query

From: Date: Sun, 31 Dec 2000 23:14:00 +0000
Subject: Newbie question with Query
Groups: php.general 
Request: Send a blank email to php-general+get-32299@lists.php.net to get a copy of this message
I'm having trouble with user validation. I have a query as follows: $query = mysql_query("SELECT * FROM clients WHERE CUserName=='$CUserName' AND CPassword=='$CPassword'"); if(!query) die ("Invalid username/password combo.") else print "Thank you for loggin in"; The problem is, it rejects a valid username/combo everytime. I am certain that there is a connection with MySQL and when I tried to do a print "$query" to see my result. It brings back nothing. In the SELECT statement, I tried to use only single "=" but it always logs the user in because i'm assigning the variables as equal AND the print "$query" displays resource id#2! Can someone help me out here? Thanks, Marc

« previous php.general (#32299) next »