2008-12-19 15:04:16 - Article

Pagenation with php example

Content.exe

Pagenate an array into a table using PHP.

This is a basic example and has been depreciated, a far more advanced and upto date example can be found here.

(Thanks to Andrew (Morf) for his help on this)

To see it in action click here

There are user configurable values at the top, such as query name, and number of results per page etc, the important thing to remember though, is the page link must be correct



$val){ $args.= $key!=$queryString ? "&".$key."=".$val : "" ; } if($all>0){ if(($listing+1) > $all_pages){$listing=0;} $of = 0; ////////////////////////////////////////// navigation starts if(($listing+1) > 1 && ($listing+1) <= $all_pages){ // up echo '«'; } if ($all_pages>1){ // goto page for($i=0;$i<$all_pages;$i++){ // echo`s the number also checks to see if this is the current page echo $listing==$i ? ''.($i+1).'' : ''.($i+1).''; if($i < ($all_pages-1)) echo ' | '; } } if(($listing+1) < $all_pages){ // down echo ' »'; } ///////////////////////////////////////// navigation ends ?>
Thing 1 Thing 2 Thing 3
No results found'; } ?>

 

You can download the complete zipped file here

I have now developed a fully automated function here which is far superior.

Comments.log - 2 entries

2 responses to “Pagenation with php example

  1. Lint Filter
    Pagination
  2. Adrian
    lol, ok

Reply to Lint Filter [Cancel Reply]

System Notice: Your email address will not be published. Required fields are marked with *

LOADING...
Initializing CyberDev systems...