浏览模式: 普通 | 列表
3月, 2012 | 1
<?

// Start snipit 1

$sql = "SELECT * from <table>";
$result = mysql_query($sql);

while ($row = mysql_fetch_assoc($result)) {
         // do stuff with $row
}

mysql_data_seek($result, 0); //关键是这儿

while ($row = mysql_fetch_assoc($result)) {
         // do other stuff with $row
}
?>


http://cn.php.net/manual/zh/function.mysql-data-seek.php#66814
1