Re: [PEAR-DEV] PEAR DB Question
by Tomas V.V.Cox other posts by this author
Aug 30 2001 2:58PM messages near this date
PEAR DB Question
|
DB::isError funny error
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
Thread:
David Arthur
Tomas V.V.Cox
|