LimitQuery help
| From: | Matt Haught | Date: | Fri, 18 Jan 2002 17:20:34 +0000 |
| Subject: | LimitQuery help | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-679@lists.php.net to get a copy of this message | ||
Hello,
I have just started using the limitQuery() function in some of my scripts,
and It works great, except for one problem. My problem occurs when I have a
query/fetchRow inside a loop from a limitQuery/fetchRow. The second is
limited to the values I put into the first even if I don't use limitQuery in
the second. For example:
//first query
$res = $db->limitQuery('SELECT * FROM table', 0, 20);
while ($row = $res->fetchRow()) {
//second query
$secd = $db->query("SELECT * FROM secdtable WHERE id = '" .
$row['id'] .
"'");
while ($row2 = $res->fetchRow()) {
echo $row2['name'];
}
}
The second query is limited to 20 even though it doesn't use limitQuery. Is
there something I am missing? I think this is a new feature, so it could be
a bug, or do I need to do something different? I have also tried using
$db->getAll($query) for the second one but got the same limited result.
Thanks,
-Matt
haughtlists@hotmail.com