我正在进行分页,由于某种原因,我不能使用mysql_fetch_array多次循环结果.
//both $page and $imagesPerPage != 0
$offset = $page * $imagesPerPage
while ($row = MysqL_fetch_array($result)) {
$total_images++;
}
echo $total_images;
//echos correct amount
$row = null;
$images_to_offset = 0;
while ($row = MysqL_fetch_array($result) && $images_to_offset < $offset) {
$images_to_offset++;
}
echo $images_to_offset;
//echos 0... which is wrong
谢谢!
最佳答案