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;
相關文章
相關標籤/搜索