5 Years
Discussion Span
Last Post by diafol

You could append the $_GET['idfield'] to the next page link

e.g. (untested) <a href="records.php?page=<?php echo $nextPageNum; ?>&idfield=<?php echo $_GET['idfield']; ?>


You can use limit in a query. And pass accordingly for each page.
I am not sure but for pagination pupose limit will help you.


You provide no code, so it's difficult to know for sure how you're paginating.

Set up a concrete url format for this, e.g.


Alternatively, this could be done via ajax, where the params are passed from a js script to a php page and fresh data returned. Unless the url is important for your SEO, the this may be a better option.

Your page links (at the bottom of the table?) should be updated with the url parameters:

$activepage = 5; // from $_GET['page'] or provide a default - it would be more complicated than this in order to stop out-of-range values
$numpages = 30; // these would be calculated usually from your pagination script.
$so = 'firstname'; //again from $_GET['sortorder'] or provide a default - again need to stop invalid entry

$pages = '<ul class="pages">';
    $pages .= ($i == $activepage) ? "<li class='active'>$i</li>" : "<li><a href='users.php?page=$i&sortorder=$so'>$i</a></li>";
$pages .= "</ul>";

The issue is how are you choosing your sortorder? If via js, then you need to overwrite the url in the <li> tags otherwise, I'm assuming by submit dropdown, in which case you could php-ify that to show the current sortorder. The dropdown form action would need to be set to

"users.php?page=<?php echo $activepage;?>"

Loads of ways to skin a cat. Provide your code so we can see how best to help you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.