基本知识:就是对id对进行order by id desc 或 order by id asc进行排序,然后再判断比当前id > or小于当前文章id的,实例的sql语句如下:
select * from news where id<$id order by id desc limit 0,1
基本知识:就是对id对进行order by id desc 或 order by id asc进行排序,然后再判断比当前id > or小于当前文章id的,实例的sql语句如下:
select * from news where id<$id order by id desc limit 0,1