x108/I2_2.php
<?php
$boeknr = $_GET['boeknr'];
?>
<!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');
$query = "select * from boeken b, auteurs a where b.auteurnr = a.auteurnr and b.boeknr=$boeknr";
$result = mysqli_query($db,$query) or die(mysqli_error($db));
$row = mysqli_fetch_array($result);
echo "<div><h2>$row[titel] | $row[voornaam] $row[tussenvoegsel] $row[achternaam]</h2></div>";
echo "<div><h3>Alle uitleningen<h3></div>";
$query1 = "select * from uitleningen u, leerlingen l where l.llnr = u.llnr and u.boeknr=$boeknr";
$result1 = mysqli_query($db,$query1) or die(mysqli_error($db));
while($row = mysqli_fetch_array($result1)){
$datum = strtotime($row['datum_uit']);
$datum = strftime('%e %b %Y', $datum);
echo "<div>$row[voornaam] $row[tussenvoegsel] $row[achternaam] | $datum</div>";
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse