l207/moordenaars_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> <html><h1>moordenaars gegevens</h1></html> <table border="1"> <tr> <th>Moord ID</th> <th>Slachtoffer ID en naam</th> <th>Plaats</th> <th>Moordwapen</th> <th>Moord Datum</th> <th>Motief</th> </tr> <?php include('db.php'); $moordenaarID = $_GET['moordenaarID']; $query = "SELECT * FROM moordenaar WHERE moordenaarID = $moordenaarID"; $result = mysqli_query($db, $query); while($row = mysqli_fetch_array($result)){ echo "<h2> {$row['moordenaarID']} {$row['voornaam']} {$row['tweedeNaam']} {$row['tussenvoegsel']} {$row['achternaam']}</h2>"; echo "<div>geboortedatum: $row[geb_datum]</div>"; echo "<div>woonplaats: $row[woon_plaats]</div>"; echo "<div>Status van de gevangene: $row[status]</div>"; } $query = "select * from gevangenis g, moordenaar m where g.gevangenisID = m.gevangenisID and moordenaarID = $moordenaarID "; $result = mysqli_query($db, $query); while($row = mysqli_fetch_array($result)){ if($row['status'] == 'gevangen'){ echo "In de gevangenis: <a href='gevangenis_gegevens.php?gevangenisID=$row[gevangenisID]'>$row[naam]</a>"; } } echo "<div><h2>moord gepleegd</h2></div>"; $query = "select * from moord m, slachtoffer s where m.slachtofferID = s.slachtofferID and moordenaarID = $moordenaarID"; $result = mysqli_query($db, $query); while ($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>{$row['MoordID']}</td>"; echo "<td><a href='slachtoffer_gegevens.php?slachtofferID=" . $row['slachtofferID'] . "'>{$row['slachtofferID']} $row[voornaam_slachtoffer] $row[achternaam_slachtoffer]</td>"; echo "<td>{$row['plaats']}</td>"; echo "<td>{$row['moordwapen']}</td>"; echo "<td>{$row['moord_datum']}</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> </body> </html>

Resultaat

Made by Thijs Aarnoudse