hi mysql_data_seek($result ,0) will move the result pointer to the beginning of the result set then while(.....) { ...... } as before Peter -----Original Message----- From: Jason McCormack [mailto:mccormack_j@hotmail.com] Sent: 20 May 2003 05:01 To: php-db@lists.php.net Subject: PHP and Mysql Queries Hello All, I have a script that runs a mysql query against my database. I need to loop through the array of data twice. My script runs the first loop as expected but when it runs the second loop I get no data returned. Is there a way to be able to loop through the same data result set twice without having to take the data set and put it into a different array variable. Any ideas are greatly appreciated. Thanks, Jason Code Block $q_navmenu = "select navmenu,count(navmenu) as count from sitenav where navgroup = 'toc' and active = 'T' group by navmenu order by navmenu"; $h_navmenu = mysql_query($q_navmenu,$connect); while($rows = mysql_fetch_array($h_navmenu)) { $navmenu = $rows["navmenu"]; echo $navmenu . "<br>"; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php