Ask a beginner about mysql_data_seek paging for PHP. I searched for the usage of mysql_data_seek on the Internet and probably understood the principle. However, I encountered a problem when I encountered a paging problem. The pages on my page, including the parameters, are all done, that is, the records are not working properly. use the following statement to ask the experts about mysql_data_seek paging.
I searched for the usage of mysql_data_seek on the Internet for a beginner's PHP, and I probably knew the principle. However, I encountered a problem in paging, so I couldn't go through it.
When all the parameters on the pages of my page are completed, that is, the records are not displayed. the result of the following statement is: The more pages are displayed, the fewer records are displayed.
Mysql_data_seek ($ result, ($ page-1) * $ pagesize );
Ask experts for help. Thank you.
------ Solution --------------------
Pagination should be:
Select * from tablename where ***** order by ** limit ($ page-1) * $ pagesize, $ pagesize;
------ Solution --------------------
Query the database on each page.
Select * from tablename where ***** order by ** limit ($ page-1) * $ pagesize, $ pagesize;
This will only query the current record, not all of them.
You seem to have found all the data.
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