Possible Duplicate:
How to reset mysql pointer back to the first row in PHP?
I have 2 while loops in my PHP script that processes a list of data from a database.
$results = mysql_query("SELECT * FROM myTable");
while ($result = mysql_fetch_object($results)) {
// do stuff
}
reset($results);
while ($result = mysql_fetch_object($results)) {
// do some more stuff
}
However, the reset() function is not resetting my pointer within the MySQL resource. In fact, it generates an error:
"Warning: reset() [function.reset]: Passed variable is not an array or object in /home/cs179_team13/public_html/timeTests/results.php on line 133."
Why? How do I reset a PHP pointer for a MySQL resource?