ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-dev
pear-dev
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved