I'm baffled (again ....)

In my mql database I'm doing:
SELECT cl_login FROM client WHERE cl_login = "xxx";

and if "xxx" exists I get the result xxx while if it doesn't exist I get an 
empty string.

In PHP I'm doing
$querytest = "SELECT cl_login FROM client WHERE cl_login = '$txtLogin';";
$testresult = mysql_query($querytest, $mysql_link);
if ($testresult) {
print "Error: Client already in database.";

Now, no matter what* I still get a result of the query: Resource id # 7
(i put in echo $testresult; when the routine didn't work).

* That I get Resource id ... if I have a cl_login = xxx or if I don't have 

What's !¤#!"#¤ going? How do I check for a duplicate before writing it to 
the database? (Short of putting UNIQUE on the table, which I suppose would 
result in an error).

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to