search

Home  >  Q&A  >  body text

Simple implementation of previous page and next page

     $front=db('archives')->where("id>".$aid)->order('id asc')->limit('1')->find();//上一页        $this->assign('front',$front);//上一页
        $after=db('archives')->where("id<".$aid)->order('id desc')->limit('1')->find();//下一页        $this->assign('after',$after);//下一页
<div class="point">             <p>上一篇:<a href="{:url('Article/index',array('aid'=>$front['id']))}">{$front['title']}</a></p>            <p>下一篇:<a href="{:url('Article/index',array('aid'=>$after['id']))}">{$after['title']}</a></p> </div>

How to write this when there is no information:www.hbsjsd.cn

手机用户105971037手机用户1059710371887 days ago1298

reply all(0)I'll reply

No reply
  • Cancelreply