日期:2014-05-16  浏览次数:20683 次

mysql获取上一篇和下一篇文章的ID
只要在当前页面读取上一个和下一个的ID就可以了。
假设当前ID为10:
搜索上一个的ID:select  id  from table where id<10 order by id desc  limit 0,1;
搜索下一个的ID:select  id  from table where id>10 limit 0,1;