Hi there,
Today i wrote the code below myself, because I couldn't get the other codes working (only a previous button, which on each page links to the same and nowhere a next button :S)
The problem with my own code is, that it puts prev-next links for each entry in the table on each page. And when i limit it to 1 result, i get the same query result (and thus the same prev-next links obviously) on each page!
It's quite an irritating problem for me and i wish i could re-do the database so that every language is in a different table....
Here's the code:
<?php
include("../../config.php");
$result1 = mysql_query("SELECT * FROM systemen WHERE (groep = 'nederland')") or die("Database Error");
while($row = mysql_fetch_object($result1)) {
$sysnaam = $row->naam;
$id = $row->id;
}
echo "<br>Test<br>";
$result2 = mysql_query("SELECT * FROM systemen WHERE (groep = 'nederland')") or die("Query Error");
$test = 0;
while($row = mysql_fetch_object($result2)) {
$currentid = $row->id;
if ($test = 1) {
$test = 2;
echo "<a href='?messageid=$currentid'>Volgende</a>";
echo " - ";
}
if ($currentname = $sysnaam) {
$test = 1;
echo "<a href='?messageid=$lastid'>Vorige</a><br>";
}
$lastid = $currentid;
}
?>
So this code creates the right buttons (most of the time, with the first and last entry that the query returns it gives an empty prev and an empty next link), but it doesn't limit the results to one previous and one next link...
HELP! 😕
Thnx again!
Ruben Raadsheer