Public functionIndex () {Import ("@.org.page");//Import page-out class$Dao=M ();$count=Count($Dao->query ("select * from Ofuser where UID in (select UID from ofid where uid = ' 1 ')");//total number of bars$Page=NewPage ($count, 10);//the number in a page is 5$list=$Dao->query ("select * from Ofuser where UID in (select UID from ofid where uid = ' 1 ') limit$Page->firstrow,$Page->listrows ");//query based on the criteria above$Page->parameter = ' search=key&name=thinkphp ';//parameter parameter//set pagination display$Page->setconfig (' header ', ' data ');//page is displayed as: 6 data $Page->setconfig (' first ', ' << ')); $Page->setconfig (' Last ', ' >> '); $page=$Page-Show (); $this->assign ("page",$page); $this->assign ("List",$list); $this-display (); //dump ($list); Echo $_session[' UID '];//displays the session value of the verification code ";}
thinkphp native SQL using page-splitting classes