I have a table which shows the first five records:
Code: Select all
<?php
$result = mysql_query("SELECT date, heading FROM messages ORDER BY message_id DESC LIMIT 0, 5");
$num_rows = mysql_num_rows($result); // the number of records returned
?>
I want to put previous and next buttons which will show the previous five and next five respectively. I was thinking about adding another page which called the same sql query but had a limit of 5, 10 etc but then thought about all those extra pages. Also, I'd have to create a separate page for every set of five. What if there are 100 messages? I have to create 20 pages. No thanks!!!
So, there has to be some fancy php variable page thingie I can do to reload the page with the new set of data upon clicking the next or previous button. Any clues on where I can start?
Thanks!