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

PHP中文网
Release: 2016-06-13 13:12:05
Original
854 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为本页
Copy after login

        已经证实,代码可用
        以此抛砖引玉,希望能遇到更好的分页技术

------解决方案--------------------
只能实现简单的翻页.........跳页、显示总页数就不行了
------解决方案--------------------
那怎么对呢?你都 limit 了 $b 能反映总数吗?

 以上就是 sql 简略便捷的分页技术(原创) 的内容,更多相关内容请关注PHP中文网(www.php.cn)!


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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!