Sorry I see my error. It was checking to see if $page had a value and when it did it would make $page = 1 so change isset at the top to empty. Hopefully that makes it works. The code should be the following.
PHP Code:
if (empty($page)
{
$page = 1;
}
//Default lower and upper limit variables
$limitlower = ($page - 1) * $limit + 1;
$limitupper = $page * $limit;
if ($limitupper > $count['count'])
{
//Too many for upper limit
$limitupper = $count['count'];
if ($limitlower > $count['count'])
{
//Too many for lower limit
$limitlower = $count['count'] - $limit;
}
}
if ($limitlower <= 0)
{
//Can't have negative or null lower limit
$limitlower = 1;
}