Using the same result set twice

From: Date: Tue, 21 Nov 2000 16:37:23 +0000
Subject: Using the same result set twice
Groups: php.general 
Request: Send a blank email to php-general+get-26468@lists.php.net to get a copy of this message
I have a page where at the top I need to display results from a query, then further down I need to use the results again. Why can I only seem to "use" the result set once? Here is the code: echo "<p>Sub-Category: <select name=\"qsubcat\"> \n"; while($newrow=mysql_fetch_array($subcats)) { $ctitle=$newrow["ctitle"]; $cid=$newrow["cid"]; echo "<option value=\"$cid\">$ctitle</option> \n"; } echo "</select> \n"; [various HTML deleted] echo "<p>Sub-Categories: \n"; while($catrow=mysql_fetch_array($subcats)) { $ctitle=$catrow["ctitle"]; echo "$ctitle - "; } c -- Chris Lott

« previous php.general (#26468) next »