Re: DB.php, if and else on query?
| From: | Ian P. Christian | Date: | Mon, 09 Aug 2004 08:45:01 +0000 |
| Subject: | Re: DB.php, if and else on query? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14015@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 09 August 2004 05:51, Louie Miranda wrote:
> $q = $db->query($sql);
> if (DB::iserror($q)) {
> die($q->getMessage());
> } elseif ($q == 0}
> die("zero value, found nothing..");
> }
Hi louise
query() reutrns a class of type DB_result, so it will never be ==0.
See this link!
http://pear.php.net/manual/en/package.database.db.db-result.php
Kind Regards,
- --
Ian P. Christian
- pookey@pookey.co.uk
- http://www.pookey.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBFzmNEe6ncNCcEO0RAvQiAJ94u5nZPlN9tCm1H8GoUC1XkYWiyACeKdQy
75XcRGakQwKZrc7jIKS4kuM=
=+N+y
-----END PGP SIGNATURE-----