Php + oracle paging class. Sample. php copy code :? Php $ connociplogon (test, 123456, test123); include_oncepager.inc.php ;? Copy the code as follows :? Php ** paging test starts * example. php
The code is as follows:
$ Conn = maid ("test", "123456", "test123 ");
Include_once "pager. inc. php ";
?>
The code is as follows:
/** Start paging test */
// {Initial paging object
$ Pager = new pager ();
/** Split select id, name, age from test where age> 20 order by id desc */
$ SqlArr = array ('conn' => $ conn, // database connection
'Fields' => "id, name, age", // query the subject sentence
'Table' => "test", // table name
'Condition' => "age> 20", // query condition
'Order' => "order by id desc" // sorting method
);
If (! $ Pager-> listn ($ sqlArr, 10, $ page) // 10 entries are displayed on each page.
{
$ Pager-> errno = 10;
Die ($ pager-> errmsg ());
}
//}}}
// {Data Display
For ($ I = 0; $ I <count ($ pager-> result); $ I ++)
{
$ Tmp = $ pager-> result [$ I];
Echo "id:". $ tmp ['id']."
";
Echo "name:". $ tmp ['name']."
";
Echo "age:". $ tmp ['age']. ""
}
//}}}
// {Display page link
Echo $ pager-> page. "/". $ pager-> totalpage. "total". $ pager-> total. "record ";
If ($ pager-> prev! = 0)
Echo "prev."> Previous Page ";
Else
Echo "previous page ";
If ($ pager-> next! = 0)
Echo "next."> next Page ";
Else
Echo "next page ";
//}}}
?>
The http://www.bkjia.com/PHPjc/315195.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/315195.htmlTechArticleexample.php code is as follows :? Php $ conn = ociplogon ("test", "123456", "test123"); include_once "pager. inc. php ";? The code is as follows :? Php/** paging test start *//...