I have implemented a pagination technique and the pages seems to work well when I edit in the url, but page 1 cannot be clicked and is still active even though I have changed to the second or third page.


$db    = JFactory::getDbo();
$query = "SELECT COUNT(*) FROM `#__bidding_items` WHERE `state` = '1'";
$total = $db->loadResult();



$pagination = new JPagination($total, $limitstart, $limit);

echo $pagination->getPagesLinks(); 

You need to set $limitstart argument to the current start item. You can get the value from input:

$app        = JFactory::getApplication();
$limitstart = $app->input->getInt('limitstart', 0);

$pagination = new JPagination($total, $limitstart, $limit, $app);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.