PHP
  Home arrow PHP arrow Previous or Next? Paginating Records w...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Previous or Next? Paginating Records with PHP - Part 3
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2005-05-10

    Table of Contents:
  • Previous or Next? Paginating Records with PHP - Part 3
  • Object-oriented paging: anatomy of the "Pager" class
  • Controlling the look of database records: defining a template file
  • Going deeper: a detailed coverage at the "displayRecords()" method
  • The final round: completing the "displayRecords()" method

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Previous or Next? Paginating Records with PHP - Part 3


    (Page 1 of 5 )

    In part three of our series about paginating records with PHP, we will learn how to make our application work with a relational database system such as MySQL. We will develop a tight, compact PHP class, capable of performing the most common paging tasks efficiently.

    Introduction

    Welcome to part three of the series "Previous or Next? Paginating Records with PHP." I hope that you've had a good time reading the previous articles, where we strongly focused our attention on implementing several approaches to paginate data in websites, using PHP's excellent capabilities. So far, we've developed a couple of methods for displaying chunks of data, appending the proper paging links, and providing an easy way to navigate across pages.

    In the first case, we explored a procedural approach for dealing with the topic, defining a function to paginate data coming from a simple text file. This approach is suitable for small applications. Analogously, in the second case, we utilized a plain text file as a data source, but this time we built up a paging PHP class to generate the visual data output and the paging links. However, our newly developed "Pager" class presents some issues that need to be properly addressed.

    Since the Web is now driven almost entirely by databases, we should be able to work with a relational database system such as MySQL to paginate result sets, and have the possibility of applying an effective visual format to retrieved records. To meet real world needs, it's highly imperative to develop a tight, compact PHP class, capable of performing the most common paging tasks efficiently, with minor hassles at most.  So, let's jump straight into the class code and create this new toy for our developer's toolbox.

    More PHP Articles
    More By Alejandro Gervasio


       · In this third part of the series, I've developed a simple yet powerful class to...
       · Good job!!!i have tried to play around with the class, modify here and there.BUt...
       · Thank you for the comments.Analyzing your situation, I suggest that you may...
       · i've found lots of examples using MySQL as the database, does anyone know how to do...
       · If you're using PEAR, take a look at the PEAR :: DB package. It offers good support...
       · Hello,I recently read this article and tried the code. It works great, thanks a...
       · Hello,Thanks for the comments and feedback. I really appreciate your time to...
       · Looks like this is just what I'm looking for. I'm a new-be to PHP and have a...
     

       

    PHP ARTICLES

    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter
    - Building Your Own System Tray Application Us...
    - Structuring Your Projects for Web Applicatio...
    - Inserting, Updating and Deleting Database Ro...
    - Building Your Own Desktop Notepad Applicatio...
    - Web Application Security Overview
    - Working with the Active Record Class in Code...
    - Generate PDF Documents with PHP on the Windo...
    - Sending Email with PHP Networking
    - Performing Strict Validation with the Code I...
    - The preg_replace_callback() function in PHP
    - PHP Networking
    - Validating Web Forms with the Code Igniter P...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT