zoukankan      html  css  js  c++  java
  • destoon 分页

    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

  • 相关阅读:
    正则表达式
    浏览器加载时间线
    浏览器事件
    脚本化CSS
    定时器元素大小位置属性等 20181231
    关于行内元素 20181229
    个人冲刺01
    周总结
    团队冲刺10
    团队冲刺09
  • 原文地址:https://www.cnblogs.com/weiyiyong/p/7382984.html
Copyright © 2011-2022 走看看