Heim  >  Artikel  >  Backend-Entwicklung  >  内容下上分页

内容下上分页

WBOY
WBOYOriginal
2016-06-13 13:22:52897Durchsuche

内容上下分页
思路:
你指定一个ID(当前的,比如是10) 
 上一页就是比10小而且是最大的。只要你去获取比10小而且是最大的。
下一页就是比10大的,而且是最小的。

求代码支持 请各位大侠帮帮忙

------解决方案--------------------
select id from table where id>当前ID limit 0,1;
select id from table where id------解决方案--------------------
select id from table where id>当前ID order by id asc limit 1; //下一条
select id from table where id
接下来就很简单了吧。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn