failed query results
| From: | baldey_uk | Date: | Sun, 28 Apr 2002 12:48:02 +0000 |
| Subject: | failed query results | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94977@lists.php.net to get a copy of this message | ||
Hello all, i am trying to query a mysql database to see if a customer all
ready exists in a database and if so then use there customer id to insert
data into another table. Can anyone tell me what valuse mysql returns if the
query returns no value? i have the following code:
$customer_id_check=("SELECT id FROM $customer_table WHERE firstname =
'$firstname' && lastname = '$lastname' && email =
'$email'");
$result1=mysql_query($customer_id_check);
if (!$result1) {
print "theres no such customer!";
}
which i thought should echo 'theres no such customer!' if a customer didnt
exist who fitted the query, however it doesnt and if i echo $result1 i get
'Resource id #2 not what i was expecting (was more expecting something along
the lines of NULL).
Thanks for any help in advance!!!
Cheers From
baldey_uk