Re: failed query results
| From: | Jason Wong | Date: | Sun, 28 Apr 2002 17:35:33 +0000 |
| Subject: | Re: failed query results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95000@lists.php.net to get a copy of this message | ||
On Sunday 28 April 2002 20:48, baldey_uk wrote:
> $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).
Have a look at the examples in the php manual and learn how to incorporate
error checking in your code.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
"BTW, does Jesus know you flame?"
-- Diane Holt, dianeh@binky.UUCP, to Ed Carp
*/