Below is the code I'm using that does not work. The first while loop uses the columns in $result to display on the fields. Then, I want to display all of the data that is in the table under each correct heading. How can I do this?
$result = mysql_query("show columns from table",$connection) or die ("Couldn't execute query.");
$data = mysql_query("SELECT * from $table ORDER BY productid",$connection) or die ("Couldn't execute query.");
while ($field = mysql_fetch_array($result))
{
echo "<td><font face=\"Arial\" size=\"3\"><b>$field[0]</b></font></td>";
}
echo "</tr>";
echo "<tr>";
$count = 0;
while ($field = mysql_fetch_array($data))
{
echo "<td><font face=\"Arial\" size=\"2\">$field[$count]</font></td>";
$count += 1;
}
echo "</tr>";