dstoltz Posted June 29, 2010 Share Posted June 29, 2010 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 More sharing options...
PFMaBiSmAd Posted June 29, 2010 Share Posted June 29, 2010 http://us4.php.net/mysql_data_seek Link to comment https://forums.phpfreaks.com/topic/206207-reusing-a-result-set/#findComment-1078823 Share on other sites More sharing options...
zackcez Posted June 29, 2010 Share Posted June 29, 2010 Do you mean echoing the rows outside of the while loop or what exactly do you mean? Link to comment https://forums.phpfreaks.com/topic/206207-reusing-a-result-set/#findComment-1078828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.