This question already has an answer here:
I've been trying to display my database and I just cannot get it to work. Any help appreciated. I've been trying to fis for over 3 hours and getting nowhere
Here's the code:
<table>
<caption><h1>Albums Details</h1></caption>
<thead>
<tr>
<th>albumID</th>
<th>Title</th>
<th>Artist</th>
<th>Country</th>
<th>Company</th>
<th>Price</th>
<th>Year</th>
</tr>
</thead>
<tbody>
<?php
HERE IS ERROR while ($res = mysqli_fetch_array($query)) { //while loop....do this
echo "<tr>";
echo "<td>".$res['albumID']."</td>";
echo "<td>".$res['title']."</td>";
echo "<td>".$res['artist']."</td>";
echo "<td>".$res['country']."</td>";
echo "<td>".$res['company']."</td>";
echo "<td>".$res['price']."</td>";
echo "<td>".$res['year']."</td>";
echo "</tr>";
}
?>
</div>