Loading

limit 用法php练习

$sql = "select * from goods order by price desc limit 0,3";去前面三条

$sql = "select * from goods order by price desc limit 3,3";去前面三条

$sql = "select * from goods order by price desc limit 6,3";去前面三条

$sql = "select * from goods order by price desc limit 9,3";去前面三条

(n-1)*3就是他的规律.分页原理就迎刃而解了

 

//倒序排列 显示3条

 

可以用来做分页,下面讲讲他的原理:

 

posted @ 2019-07-17 15:38  mingBolg  阅读(180)  评论(0编辑  收藏  举报