H4.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');
$query0 = "select distinct voornaam, llnr
from leerlingen ";
$result0 = mysqli_query($db, $query0) or die(mysqli_error($db));
while ($row0 = mysqli_fetch_array($result0)){
echo"<div></div>";
echo "<h1>$row0[voornaam]</h1>";
echo"<div>Geleende boeken</div>";
$Nodigllnr = $row0['llnr'];
$query1="select titel, datum_uit
from boeken, uitleningen
where uitleningen.llnr = '$Nodigllnr' and uitleningen.boeknr = boeken.boeknr";
$result1 = mysqli_query($db, $query1) or die(mysqli_error($db));
while ($row1 = mysqli_fetch_array($result1)){
$date = $row1['datum_uit'];
$date = strtotime($date);
$date = strftime("%A %B %Y", $date);
//echo"<h1>Geleende boeken</h1>";
echo"<div>Het boek $row1[titel] is op $date uitgeleend door $row0[voornaam] ";
}
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse