Originally Posted by KULP
Didn't think you were just gonna copy paste, but I just revised it in an actual file (was just doing it off the fly but here you go)
$cnt= 100; //Set to value in database
$currentpage = 1; // Whatever you wanna use. Use $_GET so it's dynamic.
$current = 1;
$limit = 20; //Or set to other value, or user defined.
while($current <= $cnt)
$thislast = $current + $limit;
if($thislast > $cnt)
$thislast = $cnt;
if($current == ((($currentpage - 1) * 20) + 1))
echo '<p class = "paginationBold">'. $current . ' - ' . $thislast . '</p>';
echo '<a class = "paginationLink" href = "insert url">' . $current . ' - ' . $thislast . '</p>';
$current += $limit; //Added this to update $current. Was missing.
I'm new to this.. That's why... On the insert url.. I can do page or current page? = $current, right? I had a pagination that was only previous and next and that it had my start=$next = $current + 20 or - 20
EDIT.. $cnt I'll end up doing $cnt because as you can see in the beginning of the script that's what counts to the total!