献丑了。$sql->Query("select acticle_id from acticle where item_id='$item_id'"); $all_rows=$sql->rows;//所有条数$sql->Query("select acticle_id,acticle_topic,acticle_time from acticle where item_id='$item_id' order by acticle_mid limit $offset,$perpage");//limit 开始位置,向后多少条 $rows=$sql->rows;//当前页条数$all_page=ceil($all_rows/$perpage);//共多少页 $now_page=ceil($offset/$perpage)+1;//当前页 $last_offset=$offset-$perpage; if ($last_offset<=0) $last_offset=$offset;//上一页 $next_offset=$offset+$perpage; if ($next_offset>=$all_rows) $next_offset=$offset;//下一页 $finish_offset=($all_page-1)*$perpage;//最后一页
$all_rows=$sql->rows;//所有条数$sql->Query("select acticle_id,acticle_topic,acticle_time from acticle where item_id='$item_id' order by acticle_mid limit $offset,$perpage");//limit 开始位置,向后多少条
$rows=$sql->rows;//当前页条数$all_page=ceil($all_rows/$perpage);//共多少页
$now_page=ceil($offset/$perpage)+1;//当前页
$last_offset=$offset-$perpage;
if ($last_offset<=0) $last_offset=$offset;//上一页
$next_offset=$offset+$perpage;
if ($next_offset>=$all_rows) $next_offset=$offset;//下一页
$finish_offset=($all_page-1)*$perpage;//最后一页