Sometimes we get a database of others, but there is no data dictionary, this PHP applet to help you easily solve.
The code is found on the Internet, of course, this code is just generated data dictionary, view, stored procedures and so on is the wood Oh.
-->$v) {$sql = "select * from"; $sql. = "Information_schema."
TABLES ";
$sql. = "WHERE";
$sql. = "table_name =" {$v ["table_name"]} "and Table_schema =" {$database} "";
$table _result = mysql_query ($sql, $mysql _conn);
while ($t = mysql_fetch_array ($table _result)) {$tables [$k] ["table_comment"] = $t ["Table_comment"];
} $sql = "select * from"; $sql. = "Information_schema."
COLUMNS ";
$sql. = "WHERE";
$sql. = "table_name =" {$v ["table_name"]} "and Table_schema =" {$database} "";
$fields = Array ();
$field _result = mysql_query ($sql, $mysql _conn);
while ($t = mysql_fetch_array ($field _result)) {$fields [] = $t;
$tables [$k] ["COLUMN"] = $fields;
} mysql_close ($mysql _conn);
$html = ""; Loops All table foreach ($tables as $k => $v) {//$html. = "". $v ["Table_comment"]. " "; $html. = "
"; $html. = "
". $v ["table_name"]. " ". $v ["Table_comment"]. "
"; $html. = "
Field name |
Data Type |
Default Value |
allow non-null |
Auto Increment |
Notes |
"; $html. = ""; foreach ($v ["COLUMN"] as $f) {$html. = "
" . $f ["column_name"]. " | "; $html. = "
" . $f ["Column_type"]. " | "; $html. = "
" . $f ["Column_default"]. " | "; $html. = "
" . $f ["Is_nullable"]. " | "; $html. = "
" . ($f ["EXTRA"]== "auto_increment"?) is ":" "". | "; $html. = "
" . $f ["Column_comment"]. " | "; $html. = "
"; } $html. = "
";
} Output echo "
<title>". $title."</title>
"; echo "
". $title."
";
Echo $html; echo ""; ?>
Results after run: