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! Quote 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 Quote 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? Quote Link to comment https://forums.phpfreaks.com/topic/206207-reusing-a-result-set/#findComment-1078828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.