n8w Posted August 15, 2011 Share Posted August 15, 2011 I want to walk through the mysql_fetch_array twice currently I am just running the same sql statement twice $retid = mysql_query( $sql); $retid2=mysql_query( $sql); Which, I know isn't effecient making two calls to the db when I already have the info What is the best way to walk through the result twice? similar to while ($row = mysql_fetch_array($retid)) { //my code } other stuff while ($row = mysql_fetch_array($retid2)) { //my code } Quote Link to comment https://forums.phpfreaks.com/topic/244871-while-row-mysql_fetch_arrayretid/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 15, 2011 Share Posted August 15, 2011 Reset the result pointer back to zero using - mysql_data_seek Quote Link to comment https://forums.phpfreaks.com/topic/244871-while-row-mysql_fetch_arrayretid/#findComment-1257905 Share on other sites More sharing options...
n8w Posted August 16, 2011 Author Share Posted August 16, 2011 thanks so much ! Quote Link to comment https://forums.phpfreaks.com/topic/244871-while-row-mysql_fetch_arrayretid/#findComment-1257925 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.