My first page shows fine the 15 results as requested and the links build up properly with the correct amounts at the bottom of the screen such as next, last etc.
But when I choose next the next page doesn't have any results, this is in a large form and I don't think that the values are getting passed to the next page, can't seem to pass the values as there are about 20 to be passed to the next page.
Any ideas please?
$sorter1 = "SELECT * FROM directory WHERE authorised = 'Y'";
$sorterResults1 = mysql_query($sorter1);
while ($sorterRow1 = mysql_fetch_array ($sorterResults1)){
$totalcount1++;
}
}
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
}
$rows_per_page = 15;
$lastpage = ceil($totalcount1/$rows_per_page);
$pageno = (int)$pageno;
if ($pageno < 1) {
$pageno = 1;
} elseif ($pageno > $lastpage) {
$pageno = $lastpage;
}
$limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
NEXT SELECT Statement here SELECT $limit
And here's how I show the results:
if ($pageno == 1) {
echo " FIRST PREV ";
} else {
echo " <a href>FIRST</a> ";
$prevpage = $pageno-1;
echo " <a href>PREV</a> ";
}
echo " ( Page $pageno of $lastpage ) ";
if ($pageno == $lastpage) {
echo " NEXT LAST ";
} else {
$nextpage = $pageno+1;
echo " <a href>NEXT</a> ";
echo " <a href>LAST</a> ";
}