Would anyone know how to get this result ? Basically I just need to display the columns as well.
Wanted Result image
<h1>
Harry Potter Movies
</h1>
<?php
$hostname = "localhost";
$dbUser = "root";
$dbPassword = "root";
$dbName = "harry potter movies";
$port = 3306;
$conn = mysqli_connect($hostname, $dbUser, $dbPassword, $dbName, $port);
$sql = "SELECT * FROM Movies";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo $row["movie"]. " " . $row["rating"]. " " . $row["year"]. "<br>" ;
}
} else {
echo "0 results";
}
?>