Request a PHP ORACLE 10G paging code
It seems like the online code is not many, I got one, but there is a problem is not the overall display in chronological order, only can be displayed in chronological order of each page; Though a method is taken: all of them are first fetched into an array, and then the page is submitted, and the display is truncated from the array. But still want a more mature paging program, can also be a pagination class, need code!
------Solution--------------------
Looks like you didn't figure it out.
This SQL framework is not related to moving
$sql = ' SELECT * from tbl_name ORDER by id DESC ';//Your query statement
$pagesize = number of 20;//page records
$start = ($page-1) * $pagesize;//Start offset
$sqls =<<< SQL
SELECT * from?
(
SELECT a.*, ROWNUM RN?
From ($sql) A?
WHERE ROWNUM < $start + $pagesize
)
WHERE RN >= $start
SQL;
And then use the $SQLS as the query instruction string
So:
Perform $sql when not paging
Perform $SQLS when paging
By the way, this framework was pulled out of my project. It won't be a problem.
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