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

  • 相关阅读:
    python 获取Excel 的内容
    python 获取文件Excel 的行数与列数
    python 读取Excel 取出表头(列名)
    DRF的视图组件
    Redis
    Git的故事
    DRF的JWT用户认证
    DRF的三大认证组件
    DRF的序列化组件
    DRF的请求响应组件
  • 原文地址:https://www.cnblogs.com/weiyiyong/p/7382984.html
Copyright © 2011-2022 走看看