我想做一个留言板内容的分页查询,顺序从末尾开始查,每次有新的数据更新,第一页第一个显示最新插的数据
类似这样的
$sql = "SELECT * FROM comment LIMIT $start, $count";
我用limit 发现只能从头开始查,
这是自己做的效果不是想要的,好像思路哪里不对,
求助求助!
6 个解决方案
#1
倒序排列:ORDER BY id DESC
#2
倒序,limit
#3
desc Field, Limit 0,20
#4
order by
id desc limit
数量
例如:order by id desc limit 10;
例如:order by id desc limit 10;
#5
#6
order by
id desc limit
数量
例如:order by id desc limit 100;
例如:order by id desc limit 100;
#1
倒序排列:ORDER BY id DESC
#2
倒序,limit
#3
desc Field, Limit 0,20
#4
order by
id desc limit
数量
例如:order by id desc limit 10;
例如:order by id desc limit 10;
#5
#6
order by
id desc limit
数量
例如:order by id desc limit 100;
例如:order by id desc limit 100;