php:

global $pagesize,$page;
$pagesize = 10;//分页改为10条一页
$offset or $offset = ($page-1)*$pagesize;
$tablelist1=$db->query("SELECT c.company,b.title,b.itemid,c.userid FROM `{$DT_PRE}company_brand` as l,`{$DT_PRE}company` as c,`{$DT_PRE}brand_13` as b where c.userid=l.company_id and l.brand_id=b.itemid and c.company like '%$gs%' and b.title like '%$pp%' ");
$total = $db->num_rows($tablelist1);//条数
$sqll="SELECT c.company,b.title,b.itemid,c.userid FROM `{$DT_PRE}company_brand` as l,`{$DT_PRE}company` as c,`{$DT_PRE}brand_13` as b where c.userid=l.company_id and l.brand_id=b.itemid and c.company like '%$gs%' and b.title like '%$pp%' LIMIT ".$offset.",".$pagesize;
$tablelist=$db->query($sqll);
$CAT['TAGS_pages_num'] = $total;//分页处理
$CAT['TAGS_pages'] = $pages = pages($total, $page, $pagesize);//分页处理

前台:

<?php
$page=1;//分页重置
?>

 

然后直接输出$pages

相关文章:

  • 2021-07-10
  • 2021-12-09
  • 2021-10-15
  • 2021-11-23
  • 2021-10-12
  • 2021-06-16
  • 2022-12-23
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-06-08
  • 2022-12-23
相关资源
相似解决方案