$pg=1; while($pg <= $totalpage) // display page-numbered links { if($pg == $current_page) // do not create hyperlink for current page { echo \"[<i>$pg</i>] \"; } else // create hyperlink to page $pg { echo \"<a href=\\"$PHP_SELF?opt=webdev&page=$pg\\">[$pg]</a> \"; } $pg++; }
} ?>
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
Mark Hensler posted this at 04:06 — 21st January 2002.
He has: 4,048 posts
Joined: Aug 2000
I posted some code for a paginating lists here:
http://www.vbulletin.com/forum/showthread.php?s=&threadid=37641
It prints the links a little different, but you should be able to change it without too much difficulty.
Mark Hensler
If there is no answer on Google, then there is no question.
nike_guy_man posted this at 04:59 — 21st January 2002.
They have: 840 posts
Joined: Sep 2000
I've done this using PHP gathering data from MySQL
What language/DB are you using?
joyce posted this at 06:12 — 21st January 2002.
They have: 164 posts
Joined: Nov 2001
php & mysql
nike_guy_man posted this at 06:16 — 21st January 2002.
They have: 840 posts
Joined: Sep 2000
Hello
I can email or ICQ you the file...
[email protected] or 44907087
Thanks
joyce posted this at 07:29 — 21st January 2002.
They have: 164 posts
Joined: Nov 2001
i have come out with a function, but it doesn't seems to work properly..
i limit it to 2 results to display in one page but it display all the results instead of 2.
pls go to this page and u will understand what im' trying to say:
http://www.certifyexpress.com/phpresume/job.php?opt=webdev
my function is like this:
<?php
function page()
{
$sql = \"select date, uname, exsal from biopersonal where publish='y' and (job='webdev' or job1='webdev' or job2='webdev')\";
$result=mysql_query($sql);
$numrows = mysql_num_rows($result);
$totalpage = ceil($numrows / 2);
$current_page=$HTTP_GET_VARS[\"page\"];
if(empty($current_page))
{
$current_page=1;
}
$pg=1;
while($pg <= $totalpage)
// display page-numbered links
{
if($pg == $current_page)
// do not create hyperlink for current page
{
echo \"[<i>$pg</i>] \";
}
else
// create hyperlink to page $pg
{
echo \"<a href=\\"$PHP_SELF?opt=webdev&page=$pg\\">[$pg]</a> \";
}
$pg++;
}
}
?>
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.