i need to be able to show general information tables in my database.
i currently do a 'show tables' query to get the name of each table in the db.
for each name i do a 'describe table' query to get more detailed information.
however, i am having trouble looping through the array (it returns field names, type, null, key, default, extra) correctly. with the code below i get just one row of data, when really each field needs to be on its own row...
i do:
<table>
<tr>
<td>Field</td>
<td>Type</td>
<td>Null</td>
<td>Key</td>
<td>Default</td>
<td>Extra</td>
</tr>
<tr>
while ($describe_table_query_row = mysql_fetch_array($describe_table_query_result)) {
$table_field = $describe_table_query_row[0];
$table_type = $describe_table_query_row[1];
$table_null = $describe_table_query_row[2];
$table_key = $describe_table_query_row[3];
$table_default = $describe_table_query_row[4];
$table_extra = $describe_table_query_row[5];
echo "<td>$table_field</td>
<td>$table_type</td>
<td>$table_null</td>
<td>$table_key</td>
<td>$table_default</td>
<td>$table_extra</td>";
}
echo "</tr></table><br>";
Thanks
c