PHP simplest pagination script with jQuery

While developing one project, I have a requirement of getting table data in grid. The table contains many records and need to be fetched accordingly. I started googling “PHP pagination class” and “PHP pagination library” and come across hundreds of free/ open source PHP pagination library.

Since I am not using any framework, I don’t want to use any ready-made pagination library and hence decided to write my own very easy, simplest php pagination library.

Today I am going to share that library (here its not a library/class but two simple php function).

To show large numbers of records into pagination you require offset, and range. Apart from that you need a page number series on which user click and load the required page records.

I have created two functions, first to get data from database table using offset, and page no. Second, to generate page navigation list for user.

Following function used t get records from database table

And following function is used to generate page navigation list.

Later I used jquery to delete the record from table on the fly. Following is a jquery code.

The final Output will look like below.

Download Source

About the Author

has written 69 posts.

I Love Coding, Analyzing, Designing and doing it the right way. I am obsessed about learn anything new daily and sharing what I have learn each Day. This Blog is journey of my Zeal, going through step by step to the mountain of desire to become prefect. Google Wanna Hire me ?

Copyright © 2020 All rights reserved.
Proudly powered by WordPress. Developed by 7Tech Solutions