/* ----------------------------------------------------------------------- Makes an HTML table from the specified database table name ----------------------------------------------------------------------- */ function make_table($table_name) { $db = db_connect(); $rows = $db->query("SELECT * FROM $table_name"); $cols = $db->query("SHOW FULL COLUMNS FROM $table_name"); $db->close(); while($col = $cols->fetch_assoc()) $ths .= ''.$col['Field']. ''; while($row = $rows->fetch_assoc()) { $tds .= ''; foreach($row as $value) $tds .= ''.$value.''; $tds .= ''; } $table = '

'.$table_name.'

'.$ths.' '.$tds.'
'; return $table; }