Pear DB - Reusing a database query...
| From: | David Arthur | Date: | Mon, 29 Oct 2001 12:16:34 +0000 |
| Subject: | Pear DB - Reusing a database query... | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-444@lists.php.net to get a copy of this message | ||
Any further ideas/comments on this?
>>On Thursday 30 August 2001 15:15, David Arthur wrote:
>> Is there currently a way to do this more than once?
>>
>> while ($row= $result->fetchRow()){
>> print $row["fieldName"];
>> }
>>
>> A way to 'reset'? the $result object rather than fetching it again
>> with another query to run another loop on it? I've looked on the
>> limited documentation/tutorials for info on doing this but to no
>> avail :/
>>while ($row = $result->fetchRow()){
>> print $row["fieldName"];
>>}
>$n = 0;
>// fetch row by number that it's documented
>while ($row = $result->fetchRow(DB_FETCHMODE_DEFAULT, $n++)){
> print $row["fieldName"];
>}
>This should work.
>In the other hand, perhaps we could add a "setCursorPos" method :-?
>Tomas V.V.Cox