hip1/14.8/auteurs.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
include('../db.php');
include('timestuff.php');
$auteurnr = $_GET['auteurnr'];
$query = "select *
from auteurs
where auteurnr = $auteurnr";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
$row = mysqli_fetch_array($result);
echo "<h2>$row[voornaam] $row[achternaam]</h2>";
$query = "select *
from boeken
where auteurnr = $auteurnr
order by pub_jaar";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while($row = mysqli_fetch_array($result)){
echo "<h4>$row[titel]</h4>
<div>Genre: $row[genre]</div>
<div>Publicatiejaar: $row[pub_jaar]</div>";
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse