Paging in PHP (Splitting records into pages)

Paging means showing your query result in multiple pages instead of just put them all in one long page. Imagine waiting for five minutes just to load a search page that shows 1000 result. By splitting the result in multiple pages you can save download time plus you don’t have much scrolling to do.

If there are more records in a table ( say more than 50) then it will not look nice to display all the records in one page and asking visitors to scroll down to see all the records. This will also slow the process of loading of records. So it is better to break all the collected records into different pages with a fix number of records per page ( say ten records per page) .We have to give navigational link at left and right side saying previous and next page. We also have to give links at the center so the visitor can visit in between pages of his/her choice.

To show the result of a query in several pages first you need to know how many rows you have and how many rows per page you want to show. For example if I have 295 rows and I show 30 rows per page that mean I’ll have ten pages (rounded up).

Download Script Click here

Bansal Sumit

To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *