Php + oracle pagination class _ PHP Tutorial

Source: Internet
Author: User
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 *//...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.