$total_result = mysqli_fetch_array(mysqli_query($total_sql));
這句為什么會(huì)報(bào)錯(cuò)?
這句為什么會(huì)報(bào)錯(cuò)?
2021-11-07
之前看了好多分頁(yè)教程一直搞不懂,個(gè)人覺(jué)得這個(gè)老師是所有人里面把分頁(yè)邏輯講的最清楚的,點(diǎn)一萬(wàn)個(gè)贊!
2021-05-30
//更簡(jiǎn)單的邏輯顯示分頁(yè)條
//$total: 總頁(yè)數(shù), $showPage: 要顯示的頁(yè)數(shù), $page: 當(dāng)前頁(yè)
$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: 總頁(yè)數(shù), $showPage: 要顯示的頁(yè)數(shù), $page: 當(dāng)前頁(yè)
$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--;
}
}
2019-06-27