Moving Through recordsets

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
murph2481
Forum Newbie
Posts: 20
Joined: Mon Jun 27, 2005 1:48 pm

Moving Through recordsets

Post by murph2481 »

What are the commands to move through a MySQL recordset? I know for asp it is things like recset.movenext, recset.movefirst, recset.movelast, recset.moveprev I was wondering how to move through a recordset other than using a while loop which doesn't work too well if you want to build a table with multiple columns of the same data from the database.

Also how do i tell the loop to stop in asp i could do a recset.eof to tell when i am at the end of a recordset.

The only way i know to loop through a recset in php is:

Code: Select all

<?while ($row = mysql_fetch_array ($r))?>
There has got to be better and more ways.
Thanks,
Dan
Post Reply