ページネーションに取り組んでいますが、何らかの理由で 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
データベースの行データを取得するために別の php 関数を使用する必要がありますか?
ありがとう!