l104/H14/14.6.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');
$voorgaand = null;
$query = "select voornaam, tussenvoegsel, achternaam, titel, l.llnr
from leerlingen l, uitleningen, boeken
where l.llnr = uitleningen.llnr and uitleningen.boeknr = boeken.boeknr order by achternaam";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while ($row = mysqli_fetch_array($result)) {
if($voorgaand != $row['llnr']){
if($voorgaand != null){
echo '</blockquote>';
}
echo "<h1>$row[voornaam] $row[tussenvoegsel] $row[achternaam]</h1>";
$voorgaand = $row['llnr'];
echo '<blockquote>';
}
echo "$row[titel]";
echo "<br>";
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse