real_escape_string($_GET['id']); // Escapen is BELANGRIJK $query_prefnext = "SELECT * FROM `$tabelnaam` WHERE ( id = IFNULL((SELECT MIN(id) FROM `$tabelnaam` WHERE id > '".$id."'),0 AND visible = 'Ja') OR id = IFNULL((SELECT MAX(id) FROM `$tabelnaam` WHERE id < '".$id."'),0)AND visible = 'Ja')"; /* Bovenste prev-next links*/ $result = $mysqli->query($query_prefnext); while ($row = $result->fetch_assoc() ) { if ($row['id'] < $id) { echo ''; } if ($row['id'] > $id) { echo ''; } } // content $query_news = "SELECT * , DATE_FORMAT(datum,'%d-%M-%Y') as datum_eu FROM `$tabelnaam` WHERE id = '".$id."' AND visible = 'Ja'"; $result = $mysqli->query($query_news); $data = $result->fetch_assoc(); if (empty($data['title'])) { echo "

Nieuws (nog) niet aanwezig.



"; } else echo "

" .$data['datum_eu'].'   '.$data['title']."

"; echo $data['content']; /* Onderste prev-next links*/ $result = $mysqli->query($query_prefnext); while ($row = $result->fetch_assoc() ) { if ($row['id'] < $id) { echo ''; } if ($row['id'] > $id) { echo ''; } } } else { echo "Geef een ID mee!"; // $id=1; } ?> close(); ?>