我有一個簡單的分頁劇本的第一頁上不同的行數:修改分頁腳本來顯示比別人
$product_nr = count($query); // counts the number of products
$totalpages = ceil($product_nr/$rowsperpage);
if ($currentpage > $totalpages){ $currentpage = $totalpages; }
$offset = (($currentpage - 1) * $rowsperpage);
代碼設置爲每頁顯示20行 - > $ rowsperpage = 20 ;
我需要一個想法,如何顯示只有第一頁上的18行只有,並將其餘2行添加到$ product_nr,因此它不會制止其他頁面的每頁分頁20行。
基本上是:
1st page - 18 rows;
the other pages would show 20 rows per page from the remaining rows.
任何想法?