Jump to content

reusing a result set?


dstoltz

Recommended Posts

Hi All,

 

I'm coming from a Classic ASP world, so I'm trying to understand this...

 

After I excute a loop like this:

 

while($row = mysql_fetch_object($result)){

...

...

}

 

I can no longer echo results from that object, like: echo $row->lname;

 

 

I equate this to looping through a recordset in ASP. Once your past the last record, you are at EOF. If you want to "go back" to the starting record, you have to do:

 

RecordsetName.MoveFirst()

 

Is there a way to do this kind of thing with my result object in PHP? If so, how?

 

Sorry if this is a dumb question.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/206207-reusing-a-result-set/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.