Re: LimitQuery help
| From: | Tomas V.V.Cox | Date: | Sat, 19 Jan 2002 07:51:34 +0000 |
| Subject: | Re: LimitQuery help | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-681@lists.php.net to get a copy of this message | ||
Matt Haught wrote:
>
> 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.
>
Yes, it was a bug fixed now in CVS. Thanks for the report,
Tomas V.V.Cox