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

  • 相关阅读:
    计算几何
    差三角
    约瑟夫
    字符编码
    河南省赛之Substring
    移动字母
    抽屉原理
    不要为了完成代码而写代码
    分布式文件系统优化
    降低代码的复杂度
  • 原文地址:https://www.cnblogs.com/weiyiyong/p/7382984.html
Copyright © 2011-2022 走看看