l207/slachtoffer_gegevens.php

<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="style/style.css"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <h1>Slachtoffers gegevens</h1> <table border="1"> <tr> <th>slachtoffer ID</th> <th>voornaam</th> <th>achternaam</th> <th>geboorte datum</th> <th>woonplaats</th> <th>moordwapen</th> <th>moord datum</th> <th>moordenaar</th> <th>motief</th> </tr> <?php include('db.php'); $slachtofferID = $_GET['slachtofferID'] ?? null; $query = "select * from slachtoffer s, moord m, moordenaar mo where m.slachtofferID = s.slachtofferID and m.moordenaarID = mo.moordenaarID and s.slachtofferID = $slachtofferID"; $result = mysqli_query($db, $query); while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>{$row['slachtofferID']}</td>"; echo "<td>{$row['voornaam_slachtoffer']}</td>"; echo "<td>{$row['achternaam_slachtoffer']}</td>"; echo "<td>{$row['geb_datum']}</td>"; echo "<td>{$row['woon_plaats']}</td>"; echo "<td>{$row['moordwapen']}</td>"; echo "<td>{$row['moord_datum']}</td>"; echo "<td><a href='moordenaars_gegevens.php?moordenaarID=" . $row['moordenaarID'] . "'>{$row['voornaam']} $row[achternaam]</td>"; echo "<td>{$row['motief']}</td>"; echo "</tr>"; } ?> <button onclick="location.href='moorden.php'">moorden</button> <button onclick="location.href='moordenaars.php'">moordenaars</button> <button onclick="location.href='slachtoffers.php'">slachtoffers</button> <button onclick="location.href='index.php'">homepagina</button> </table> </body> </html>

Resultaat

Made by Thijs Aarnoudse