<?php
$server = ("Q3L");
$username = ("acme");
$password = ("******");
$db = ("news");
//Maak verbinding met server
$connection= mysql_connect($server, $username, $pass) or die ("Sorry, connection not establishing!<BR>");
//selecteer database
mysql_select_db($db) ro die ("Sorry, database:<b>$db</b> not have exist<BR>");
//Selecteer alle id's en titels van je tabel!
$query = "SELECT id, titel FROM nieuws";
//Voer query uit!
$result = mysql_query($query, $connection) or die ("Query failed! : ".mysql_error());
//Maak OO van $result
while ($obj = mysql_fetch_object($result)){
//Echo titel met link naar toonbericht.php
echo '<a href="toonbericht.php?id='.$obj->id.'">'.$obj->titel.'</a><br>';
}
?>