So I have a database from which I want to output data in the form of a table.
<table>
<tr>
<th class="tg-031e">Username</th>
<th class="tg-031e">Password</th>
</tr>
..
</table>
For now I get the data like this:
<?php include 'connect.php';
echo "<tr><td class='tg-031e'>";
$SQL = "SELECT `Username` FROM `Users` WHERE ID=1";
$exec = mysql_query($SQL, $connection);
while($row = mysql_fetch_array($exec)){
echo $row['Username'] . "</td>";
} ?>
However, in that case I need to echo out each column independently. How can I make PHP dynamically create an HTML table row with the information from the database whenever new data is present in the MySQL columns?