Det skulle hvis nok være sådan her:
<?php
$gb = $_GET[gb];
$mi =($gb-5);
$pl =($gb+5);
$sql = mysql_query("SELECT * FROM `gb` ORDER BY id DESC LIMIT 1");
$row_gb = mysql_fetch_array($sql);
if($gb == NULL OR $gb > $row_gb[id] OR $gb < 5)
{
$gbtal ="5";
} else {
$gbtal ="5";
}
$sql2 = mysql_query("SELECT * FROM `gb` ORDER BY id DESC LIMIT $gb, $gbtal");
while(mysql_fetch_array($sql2))
{
//Gæstebogen her//
}
if($gb < 5 OR $gb == NULL)
{
echo "Forrige";
} else {
echo "<a href=\\"http://www.adresse.dk?gb=$mi\\">Forrige</a>";
}
echo " - ";
if($gb > $row_gb[id])
{
echo "Næste";
} else {
echo "<a href=\\"http://www.adresse.dk?gb=$pl\\">Næste</a>";
}
?>