x100/H4.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>H4</title>
</head>
<body>
<?php
include('db.php');
$query = "select *
from leerlingen
";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while($row=mysqli_fetch_array($result)){
echo "<div>$row[voornaam] $row[tussenvoegsel] $row[achternaam]</div>";
$llnr = $row['llnr'];
$query = "select titel, datum_uit
from boeken b, uitleningen u
where b.boeknr = u.boeknr and u.llnr = '$llnr'";
$result = mysqli_query($db, $query) or die(mysqli_error($db));
while($row=mysqli_fetch_array($result)){
$datum = strftime("%d %B %Y" , strtotime($row['datum_uit']));
echo "<div>$row[titel] $datum</div>";
}
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse