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 
Dedicated Servers 
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 1
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    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:
      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 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


       · Over the first part of the series, I show a procedural solution to easily paginate...
       · Use PEAR.http://pear.php.net/package/Pager"It takes an array of data as...
       · Yeah, PEAR is good to paginate records. However, the article is aimed to introduce...
       · When Notice: Undefined index: page in pageinate.php on line 20I understand a...
       · Thank you for your kind words.There is nothing wrong in your php configuration....
       · Alternatively, you can use the following...
       · HiFirstly, thanks for the great pagination script you have developed.I used...
       · Thank you for the compliments on my PHP paging script. Now straight to your...
     

       

    PHP ARTICLES

    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway