PHP
  Home arrow PHP arrow Previous or Next? Paginating Records with PHP, part 1
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PHP

Previous or Next? Paginating Records with PHP, part 1
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 22
    2005-04-26


    Table of Contents:
  • Previous or Next? Paginating Records with PHP, part 1
  • The first step: paginating records in a procedural way
  • A deeper look at the "paginatetRecords()" function
  • Putting the "paginateRecords()" function into action: procedural record paging

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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 1
    ( Page 1 of 4 )

    Putting all of your content for a particular file on one page can be very user unfriendly to website visitors. Nobody likes to be confronted by a tiny vertical scroll bar! In this article, the first in a series, you will learn a simple way to paginate records from a text file using PHP.

    Introduction

    We see it every day, when surfing the Web looking for new content to expand our background as Web developers. More and more websites offer vast amounts of fresh information to satisfy users and keep them coming back for more. Most of the time, data is stored in databases and displayed according to user requests, in a fairly decent way, sticking more or less to the principles of readability. So, what's wrong about it?

    If we take a look at some popular professional websites, we immediately notice that they offer some kind of paginating mechanism to display database records. From simple "previous" and "next" navigational links, to more complex numerated links, the range is quite wide. Let's take the case of Google, for showing an excellent example of a sophisticated and efficient paginating system. Fine, let's admit it. Here, we're talking about the big boys who most of the time (but certainly not always) do know what approach to take when dealing with record paging.

    But, what about the others? Don't tell me that you never had to suffer that annoying experience of finding a website that happily loads its content, while you're watching with a feeling of growing panic as the vertical scroll bar control gets tinier and tinier! Oh, is that a severe punishment, or what?

    But let's stop being ironic and face the problem that we have here. Showing elegant, paginated information gives our sites a very polished look, and certainly is a great way to enhance readability for visitors. Thus, the subject is relevant enough to be seriously considered. That's where this article comes in. We're going to present different approaches for implementing an efficient paginating mechanism using PHP, which hopefully will be useful to employ on any existing or future Web projects. So, let's jump to the next section to find out more.



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek