$total_result = mysqli_fetch_array(mysqli_query($total_sql));
這句為什么會(huì)報(bào)錯(cuò)?
這句為什么會(huì)報(bào)錯(cuò)?
2021-11-07
//更簡(jiǎn)單的邏輯顯示分頁條
//$total: 總頁數(shù), $showPage: 要顯示的頁數(shù), $page: 當(dāng)前頁
$start = 1;
$end = $total;
if($total > $showPage){
if($page > 2) $start = $page - 2;
if($page < $total - 2) $end = $page + 2;
while($end - $start < 4){
if($start ==1) $start++;
if($end==$total) $end--;
}
}
//$total: 總頁數(shù), $showPage: 要顯示的頁數(shù), $page: 當(dāng)前頁
$start = 1;
$end = $total;
if($total > $showPage){
if($page > 2) $start = $page - 2;
if($page < $total - 2) $end = $page + 2;
while($end - $start < 4){
if($start ==1) $start++;
if($end==$total) $end--;
}
}