Could someone read this code and tell me how it loops. Is it looping from left to right or from top to bottom to create the table. It seems silly but it will help in how i am trying to modify it. What i really want to know is if it is creating a column head and column body one column at a time or creating all the heads from left to right then all the column body cells from left to right. Hope i am not confusing. Here is the code:
Code:mysql_select_db($database_myPlaceConn, $myPlaceConn); $query="select * from myp_massuploads"; $result=mysql_query($query,$myPlaceConn) or die("Query ($query) sucks!"); $fields=mysql_num_fields($result); echo "<table>\n<tr>"; for ($i=0; $i < mysql_num_fields($result); $i++) //Table Header { print "<th>".mysql_field_name($result, $i)."</th>"; } echo "</tr>\n"; while ($row = mysql_fetch_row($result)) { //Table body echo "<tr>"; for ($f=0; $f < $fields; $f++) { echo "<td>$row[$f]</td>"; } echo "</tr>\n";} echo "</table><p>";