// Returns a bunch of information about a table...// The name of the auto-increment field, if any, fields in the// primary key (using the function above), and all information// about all fields.function getTableInformationOf($table) {$information = array("auto" => "","primary" => array(),"fields" => array() );

Every my html table output begins with heading row containing the field names. For that purpose I accepted the short combination of MySQL function, giving me a result similar to the mysql_fetch_array() for the row of values. The following example shows the basic idea. It should be adapted for the specific use:

The advantage of this is, that it gives the names of the result, neither the field names of the whole table. Please read the discussion about duplicate field names in SQL result carefully. The use, as shown in the example above, increments the pointer, hence some regular function, which does not, could be more useful :-)