Re: PEAR DB Question
| From: | Tomas V.V.Cox | Date: | Thu, 30 Aug 2001 14:58:07 +0000 |
| Subject: | Re: PEAR DB Question | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1723@lists.php.net to get a copy of this message | ||
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