Thinkphp comes with pagination use case:
$Data = m (' data '); // instantiate the data object date is your table name import (' ORG. Util.page ');// import paging class $count = $Data->where ($map)->count ();// The total number of records that the query meets the requirements $MAP represents the query criteria $Page = new page ($count);// instantiate the paging class Incoming total records $show = $Page->show ();// pagination display output / / Paging data query $list = $Data->where ($map)->order (' id ')->limit ($ Page->firstrow. ', '. $Page->listrows)->select (); // $Page->firstrow starting bar $Page- >listRows get how many $this->assign (' list ', $list);// assignment Datasets $this->assign (' page ', $show);// assignment paging output $this->display (); // Output Templates <table cellpadding=3 cellspacing=5>< Volist name= "LIst " id=" vo "><tr><td >[ {$vo. create_time|date= ' y-m-d h:i:s ', ###} ] {$vo .title} </td></tr></volist><tr> </tr></table><div class= "Result page" >{$page}</div>
Paging Effect:
650) this.width=650; "src=" Http://www.thinkphp.cn/Uploads/editor/2015-11-06/563cccd6b7d0a.png "alt=" 563cccd6b7d0a.png "/>
Thinkphp comes with pagination class