Re: Exact equivalent of mysql_data_seek() in PEAR DB
| From: | Justin Patrin | Date: | Wed, 08 Feb 2006 18:33:02 +0000 |
| Subject: | Re: Exact equivalent of mysql_data_seek() in PEAR DB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22863@lists.php.net to get a copy of this message | ||
On 2/7/06, Christopher Watson <skygeex@gmail.com> wrote:
> I note that PEAR DB added, quite some time ago, a second optional
> parameter to the fetchRow() method of DB_result to fetch a specific
> row by number. But that method advances the result pointer to the
> next row. That's not how mysql_data_seek() works, which establishes
> the result pointer at the given row, but does not advance it. I have
> been using the data_seek() method of the mysqli libraries, but have
> now converted to PEAR DB. Unfortunately, I have a need to set the
> result point to 0, and _THEN_ iterate through each of the rows from
> the first to the last. How do I do that in PEAR DB???
>
Why? You can iterate through the results normally already. I suggest
either changing your login to loop through the data only once or
looking into perhaps MDB2 (I'm not sure if this is supported in it,
but it is worth a look).
--
Justin Patrin