This is a great idea..
what i have now is a bit simpler..
while($row = mysql_fetch_row($result))
echo "<td> $rownumber </td>";
foreach($row as $cell)
echo "<td align='center' border='1' bordercolor=black>$cell</td>";
I'll see what i can do with what you have above, but i'd like to see what the 2x queries structure may look like as well..
Maybe this thread should be moved to the SQL forum?