I have a query to output data within my MYSQL database and would like it to display in a table. With “Name” and “UserID” as the headings… currently the code I have developed, does output the results but instead creates multiple instances of the table and doesn’t create new rows.
Please could someone help me achieve my goal?
echo"
<table width='400' border='1'>
<tr>
<td>Name</td>
<td>SystemID</td>
</tr>
<tr>
<td> ".$row['FullName']." </td>
<td> ".$row['UserID']." </td>
</tr>
</table>";
The Table should be defined outside of the loop of the data, you just loop through the data and add a row on every loop :