Hey Mike, I saw your other problem about printing all fields into a table from a DB table. Now, I know you might have solved the problem already, but consider this method, which basically does all the work for you, and requires no changes to the code if you add more fields to the Db table etc..
$r = mysql_query($sql);
$numberoffields = mysql_num_fields($r);
echo "<TABLE>";
$i = 1;
while ($rr = mysql_fetch_array($r))
{
echo "<TR>";
for ($ii=0; $ii < $numberoffields; $ii++)
{ if ($i == 1) { echo "<TD><BOLD>" . mysql_field_name($r, ii) . "</BOLD></TD>"; } else { echo "<TD>${rr[$ii]}</TD>"; } }
echo "</TR>";
$i++;
}
That's it. It'll print all the fields in the DB, based on the SELECT of course, with the title of the fields printed once at the top of the page.