Re: PEAR DB examples?
| From: | Andrei Zmievski | Date: | Fri, 08 Sep 2000 13:37:00 +0000 |
| Subject: | Re: PEAR DB examples? | ||
| References: | 1 2 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-237@lists.php.net to get a copy of this message | ||
On Fri, 08 Sep 2000, Stig Bakken wrote:
> I usually approach this in one of three ways depending on what the
> application needs:
> [snip]
Stig,
Thanks for sharing the implementation examples. Currently, I use a class
based on PHPLIB's database class with some custom additions. Sometimes,
there is a need for more than one database object to be active, like if
I'm processing one set of items and each item requires another query.
Example:
$sql = new SQL;
$sql2 = new SQL;
$sql->query("select article_id from articles where author_id = 1");
while ($sql->next()) {
$sql2->query("select image_id from images where article_id = ".
$sql->record['article_id']);
...
}
So, here two handles are necessary. How would you do it with PEAR DB?
-Andrei
"The galaxy is, in other words, an immensely, intrinsically,
and inexhaustibly interesting place." -- Iain M. Banks