Possible Duplicate:
How to reset mysql pointer back to the first row in PHP?
我在PHP书中有2处,处理一个数据库的数据清单。
$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
}
然而,重新定位功能并没有在我的SQL资源范围内重新确定我的协调人。 事实上,它产生了一个错误:
"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?