News Feed
Sections




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

PHPMaster.com:
Pagination with CodeIgniter
January 30, 2012 @ 12:15:22

On PHPMaster.com today there's a new tutorial showing you how to handle simple pagination in a popular PHP framework, CodeIgniter.

Pagination is particularly useful when you are coding an application that interfaces with a database. A large dataset might have hundreds of possible results for one query, and pagination creates a much nicer user experience. In this tutorial, I'll use CodeIgniter's pagination library to show you how you can create a paginated list of results from a MySQL database. Along the way, you'll also see how to fix a problem with the pagination links that the library might produce.

He starts on the backend, creating a model to work with Country information and includes a "fetch_countries" method to grab the limited/paged list. Next up is the controller with an "example1" method that looks to the URL to see what page it should be on. The view is simple enough - just outputting the results back without worrying about how many to show.

0 comments voice your opinion now!
codeigniter framework tutorial pagination mvc country


blog comments powered by Disqus

Similar Posts

Script-Tutorials.com: Autocomplete with PHP, jQuery, MySQL and XML

DevShed: An Introduction to Simulating the Model-View-Controller Schema in PHP

PHPMaster.com: Avoid the Original MySQL Extension, Part 1

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 6)

Anthony Ferrara: Framework Fixation - An Anti Pattern


Community Events





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


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

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