News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PaperMashup.com:
Easy PHP Pagination
December 22, 2009 @ 10:38:08

In a new post to Ashley Ford's blog there's a tutorial on paginating your data (from an array of data pulled from a database) with a simple PHP script:

I've had a few pagination scripts over the years but I thought i'd share the one that i'm currently using as it's a useful script to have in your toolbox. As a developer you'll soon find a need to paginate data when displaying contents from the database, and rather than use JavaScript which could require all the data to be loaded into the page on load, we can use PHP to ensure that we're only requesting the data that we need from the database.

Some sample code is included showing how to use the LIMIT statement (there's similar features in the other major databases) to only pull a subset of the data needed back into your script. Some CSS is also included to make it all look a bit. You can see it in action here and download the source here.

1 comment voice your opinion now!
pagination tutorial database


blog comments powered by Disqus

Similar Posts

PHPFreaks.com: Regular Expressions (Part1) - Basic Syntax

Zend Developer Zone: Indexing Email Messages with PHP, Zend Lucene and Sphinx

Gonzalo Ayuso's Blog: Howto Send/Read SMSs using a GSM modem, AT+ commands and PHP

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite

ThinkPHP Blog: Methods to Reduce the Load of Your Webserver by Caching Content


Community Events





Don't see your event here?
Let us know!


list unittest developer podcast testing community interview framework api introduction threedevsandamaybe series laravel refactor install release code language symfony2 opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework