l102/website/staff.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> <link rel="stylesheet" href="style.css?t=<?php echo time() ?>"> <?php include ('functions.php'); include ('db.php'); include ('menu.php');?> </head> <body> <?php echo '<h3>Staff:</h3>'; echo "<table><tr><th>Voornaam</th><th>Achternaam</th><th>Rol</th><th>Team</tr>"; $query = "SELECT * FROM teams t, staff s WHERE t.teamID = s.teamID"; $result = mysqli_query($db, $query) or die(mysqli_error($db)); while($row = mysqli_fetch_array($result)){ echo "<tr><td>$row[staffvoornaam]</td><td>$row[staffachternaam]</td><td>$row[rol]</td><td>$row[team_naam]</tr>"; } //dit laat alle staff zien van een team, hun voornaam, achternaam, team en rol worden weergegeven via een query. het wordt uit staff en teams gehaald die aan elkaar gelinkd worden zodat je uit beide informatie kan halen en gebruiken. ?> </body> </html>

Resultaat

Made by Thijs Aarnoudse