Re: Resetting the pointer in an array used for a while() loop
| From: | John W. Holmes | Date: | Mon, 03 May 2004 11:50:44 +0000 |
| Subject: | Re: Resetting the pointer in an array used for a while() loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185186@lists.php.net to get a copy of this message | ||
Dave G wrote:
<?php $queryA = "SELECT row1, row2 FROM table WHERE row1=" . $variable; $resultA = mysql_query($queryA); while($array = mysql_fetch_array($resultA)) The problem is that later on in the code, I want to do another while() loop, using the same results from $QueryA. But having already been used in a while loop already, the results of mysql_fetch_array($ResultA) seem to be at the end of the list.Use mysql_data_seek() to return to the beginning of the result set. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com