微擎分页

	    	$tcate = $_GPC['cate'];
		$page = ((!(empty($_GPC['page'])) ? intval($_GPC['page']) : 1));
		
		    $pagesize = ((!(empty($_GPC['pagesize'])) ? intval($_GPC['pagesize']) : 10));
		    $p= ($page-1)*$pagesize;
		    
            $total = pdo_fetchcolumn('select count(id) from '.tablename('ewei_shop_goods')."where tcate= '$tcate' and status = 1");
            
            $goods = pdo_fetchall("select id,title,thumb,productprice,marketprice,total from ".tablename('ewei_shop_goods')."where tcate= '$tcate' and status=1 order by displayorder LIMIT $p,$pagesize");
            $pager = pagination($total, $page, $pagesize); 

  

   $page 是页码

   $pagesize 是页面容量

   $taotal 是页面总数

世界上最美的风景,是自己努力的模样
原文地址:https://www.cnblogs.com/xiong-hua/p/12626522.html