02-07-2008, 02:42 PM
|
#5 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Heres the whole thing I made:
PHP Code:
$max = 3; $p = $_GET['p']; $limit = ($p - 1) * $max; $rows = @mysql_num_rows($query); $numOfPages = ceil($rows/$max); if ($p < 1) { $p = 1; } elseif ($p < $numOfPages ) { $p = $numOfPages; }
if (!isset($prev)) { $prev = $p - 1; echo '<a href="/?p='.$prev.'">'.$prev.'</a>'; } for ($i=1;$i<=$numOfPages;$i++) { echo '<a href="/?p='.$i.'">'.$i.'</a>'; } if (!isset($next)) { $next = $p + 1; echo '<a href="/?p='.$next.'">'.$next.'</a>'; }
This whole script is from a tutorial really.. So, don't blame me about variable naming. -_-
__________________
VillageIdiot can have my babbies ;d
|
|
|
|