Is there a better method to display data from a mysql table rather than having to create a table and then hardcode headers, and the fields within the table?
The pseudo code for what I am currently doing is
<table>
<tr>
<th>I am </th><th> harcoded</th>
</tr>
mysql loop through data
for all fields
while($row = mysql_fetch_assoc($result)){
<tr>
<td>data
</td>
<td>data
</td>
</tr>
}
</table>
I usually do something like this:
update: here’s a function I wrote a few years ago that I use sometimes