Stukje PHP/SQL voor detail scherm


<html>
<body>
<?php
$db = mysql_connect("localhost", "VERVANG_DIT_DOOR_USERID", "VERVANG_DIT_DOOR_PASSWORD");
mysql_select_db("VERVANG_DIT_DOOR_DATABASE_NAAM",$db);

$query = "SELECT fotoURL, adres FROM huis WHERE id=$id";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$fotoURL = $row["fotoURL"];
$adres = $row["adres"];

echo "\n<h1>Huis: $adres</h1>";
echo "\n<img src=\"$fotoURL\">";
?>

</body>
</html>