Help with PHP paging...
Posted: Thu Sep 09, 2004 5:12 pm
Hello,
This is a new post and has nothing to do with the bottom replies... I am trying to do Paging and need some help...
I got this code online, but I dont remember what site it was from...
Here's what part of the code looks like:
There are 15 items in my table and I want to print 6 items each page... The above code prints all 15 items in First Page and show me with Previous |Next .. and Next links to listBooks.php with the same 15 items in the First Page...
Any ideas y it does that???
Thanks for all your help..
This is a new post and has nothing to do with the bottom replies... I am trying to do Paging and need some help...
I got this code online, but I dont remember what site it was from...
Here's what part of the code looks like:
Code: Select all
PHP: Pager.php
function nextPrev($curpage, $pages)
{
$next_prev = "";
if (($curpage-1) <= 0)
{
$next_prev .= "Previous";
}
else
{
$next_prev .= "<a href="".$_SERVERї'PHP_SELF']."?page=".($curpage-1)."">Previous</a>";
}
$next_prev .= " | ";
if (($curpage+1) > $pages)
{
$next_prev .= "Next";
}
else
{
$next_prev .= "<a href="".$_SERVERї'PHP_SELF']."?page=".($curpage+1)."">Next</a>";
}
return $next_prev;
}Code: Select all
PHP: listBooks.php
$next_prev = $p->nextPrev($_GETї'page'], $pages);
echo $next_prev;Any ideas y it does that???
Thanks for all your help..