l204/Races.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>Races</h1></html>
<table border="1">
<tr>
<th>RaceID</th>
<th>RaceNaam</th>
<th>Circuit</th>
<th>Datum</th>
<th>WinnaarID</th>
</tr>
<button onclick="location.href='Auto.php'">auto</button>
<button onclick="location.href='Resultaten.php'">resultaten</button>
<button onclick="location.href='coureur.php'">coureur</button>
<button onclick="location.href='index.php'">homepagina</button>
<?php
include('db2.php');
$query = "SELECT * FROM Races";
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td><a href='Racedetails.php?RaceID=" . $row['RaceID'] . "'>{$row['RaceID']}</td>";
echo "<td>{$row['RaceNaam']}</td>";
echo "<td>{$row['Circuit']}</td>";
echo "<td>{$row['Datum']}</td>";
echo "<td>{$row['WinnaarID']}</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse