MySQL

Zoekresultaten

Zoekresultaten weergeven in een tabel
<?php
$conn = new mysqli ("", "", "", "");
$sql = "SELECT * FROM top_5000_songs WHERE list_eu > 21.000 ORDER BY year ASC";
$result = $conn -> query($sql);
echo "<table width='100%' class='demo-table'>";
echo "<thead>";
echo "<tr>";
echo "<th>Song</th>";
echo "<th>Artist</th>";
echo "<th>Year</th>";
echo "</tr>";
echo "</tbody>";
echo "<tbody>";
while ($row = $result -> fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row["song"] . "</td>";
echo "<td>" . $row["artist"] . "</td>";
echo "<td>" . $row["year"] . "</td>";
}
echo "</tr>";
echo "</tbody>";
echo "</table>";
$conn -> close();
?>