I1_2.php
<?php
include "db.php";
$auteurnr = $_GET["auteurnr"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
td{
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<?php
if(isset($auteurnr)){
$result = mysqli_query($db, "SELECT voornaam, tussenvoegsel, achternaam FROM auteurs WHERE auteurnr=$auteurnr");
$row = mysqli_fetch_array($result);
echo "<h1>$row[0] $row[1] $row[2]</h1>";
$result = mysqli_query($db, "SELECT titel FROM boeken WHERE auteurnr=$auteurnr");
while($row = mysqli_fetch_array($result)){
echo "<tr><td>$row[0]</td></tr>";
}
}
?>
</table>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse