I have a mysqli database with a table for markers and a table for people.
On a web page, I'm displaying a list of people's records from this year:
SELECT * FROM markers m, people p WHERE m.MarkerID = p.MarkerID and p.Publish=1 and year(m.date) like '2015'
When you click a person from the list, you get a new webpage that displays that person's data using this query in php:
$name = $_POST['name'];
$newname = str_replace("_", " ", $name);
$q = "SELECT * FROM people p, markers m where p.MarkerID = m.MarkerID and p.Name = '" . $newname . "'";
At the bottom of the page are arrows you can click for the next record and the last record.
How would I retrieve the next or last record please? The next record would be the one that comes next by date from the first query; the prior record would be the one that comes prior by date from the first query.