Paginating Database Records with the jQuery Quick Pagination Plug-in
(Page 1 of 4 )
In this fourth part of a five-part series, I start developing a basic database-driven web application that displays a list of fictional users fetched from a MySQL table. The application is capable of generating a couple of static sections of a web page, including the typical header and footer sections.
As you may have heard many times before, there’s an old proverb that says that the best things of life are free; this becomes clear when paginating data on web pages by using a jQuery plug-in. What’s more, the proverb would have to finish with the phrase “and simple too,” since there exists a small package called “Quick Pagination” developed by Mark Perkins. When coupled with jQuery, it implements a basic, effective mechanism that permits developers to paginate a great diversity of HTML elements, including divs, paragraphs, list items and so forth with extreme ease.
Of course, if you’ve been a loyal follower of this series and have already read the three tutorials that precede this one, then you're already familiar with using Quick Pagination for paginating a few static web page elements. In those articles I created some examples to demonstrate the functionality offered by the plug-in when put it to work with collections of paragraphs and images.
Asides from showing how to use the core features provided by Quick Pagination, the examples also illustrated how to tweak some of its additional parameters, including the removal of its default page counter, a process achieved programmatically that was really easy to follow.
All of the code samples developed so far showed how to utilize the plug-in for paginating only static HTML elements. Admittedly, this is educational, but doesn't mimic more realistic environments, where the paginated data in most cases are pulled from one or more databases.
To make things a little more realistic, in the lines to come I’m going to start creating a small server-side application in PHP 5, which will fetch some records from a MySQL table that will be nicely paginated with the Quick Pagination plug-in.
Want to see how this web application will be built? Then begin reading now!
Next: Building a sample MySQL table >>
More JavaScript Articles
More By Alejandro Gervasio