Home > Backend Development > PHP Tutorial > sql 简略便捷的分页技术(原创)

sql 简略便捷的分页技术(原创)

WBOY
Release: 2016-06-13 10:48:00
Original
1017 people have browsed it

sql 简单便捷的分页技术(原创)
$i=10;//一页显示10个
if(isset($_GET['a']))
$a=$_GET['a'];
else
$a=0;
  //连接,选中数据库后
  $query="SELECT * FROM entries ORDER BY date_entered DESC limit $a,$i ";
  //查询处理后,
   
  print '

下一页 上一页

';//test.php为本页
  已经证实,代码可用
  以此抛砖引玉,希望能遇到更好的分页技术

------解决方案--------------------
只能实现简单的翻页.........跳页、显示总页数就不行了
------解决方案--------------------
那怎么对呢?你都 limit 了 $b 能反映总数吗?
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template