STRUCTURE OF '$dbname' TABLE \n"; $tbl_List = mysql_list_tables($dbname); $i = 0; while ($tables = mysql_tablename($tbl_List, $i)) { $i++; } echo "

TOTAL COUNT : $i tables

"; print "
    \n"; while ($row = mysql_fetch_row($result)) { print "
  1. $row[0]
  2. \n"; } print "
\n

Print database structure

\n"; } else { } mysql_free_result($result); /* DETAILS https://jadendreamer.wordpress.com/2009/01/13/print-all-mysql-database-tables-fields-using-php/ */ // loop to show all the tables and fields $loop = mysql_query("SHOW tables FROM $dbname") or die ('cannot select tables'); while($table = mysql_fetch_array($loop)) { echo " "; $i = 0; //row counter $row = mysql_query("SHOW columns FROM " . $table[0]) or die ('cannot select table fields'); while ($col = mysql_fetch_array($row)) { echo " "; $i++; } //end row loop echo "
" . $table[0] . "
Field Type Key Default Extra
" . $col[0] . " " . $col[1] . " " . $col[2] . " " . $col[3] . " " . $col[4] . "
\n\n"; } //end table loop ?>