Hi Ray,
Try this, i haven't tested it.
add this to your code just before while loop (after $num_rows)
$max_records=5;
$tot_pages=ceil($num_rows/$max_records);
if (empty($page)){
$page=1;
}
$start_rec=($page-1)*$max_records+1;
$end_rec=$page*$max_records;
if ($page == 1){
$prev_page = 1;
} else {
$prev_page = $page-1;
}
if($page == $tot_pages){
$next_page = $page;
} else {
$next_page = $page + 1;
}
In your while while loop use this
$count++;
if($count>=$start_rec && $count<=$end_rec)
{
// print the data;
}
For your prev and next links (after while loop)
echo "<a href=\".........?page=$prev_page\">Prev</a>";
echo "<a href=\".......?page=$next_page\">Next</a>";
Hope this works for you
Cheers
Ajay