在模板里边要显示分页的地方写上

<div class="page" style="clear:both;margin:15px 5px;">$multi</div>

在程序里边加入

$page = empty($_GET['page'])?1:intval($_GET['page']);
if($page<1) $page=1;
$id = empty($_GET['id'])?0:intval($_GET['id']);

$perpage = 8; //每页要显示的条数
$start = ($page-1)*$perpage;
ckstart($start, $perpage);
$count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM 你的表名 WHERE 你的查询条件"),0);
$query = $_SGLOBAL['db']->query("SELECT * FROM 你的表名 where 你的查询条件 limit $start,$perpage");
while ($row = $_SGLOBAL['db']->fetch_array($query)){
   $list[] = $row;
}
$multi = multi($count, $perpage, $page, "你也没的地址例如:(space.php?uid=$space[uid]&do=gift)", '', 'comment_ul');

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-03-04
  • 2022-12-23
  • 2021-07-15
  • 2022-01-01
猜你喜欢
  • 2021-09-04
  • 2022-02-06
  • 2021-06-01
  • 2021-07-26
  • 2021-10-04
  • 2021-11-11
相关资源
相似解决方案