Query MySQL database/SQL statements for table-related information: SHOW DATABASES//lists the MySQL Server databases. SHOW TABLES [from db_name]//lists the database data tables. SHOW CREATE TABLES Tbl_name//Export the data table structure. SHOW TABLE STATUS [from db_name]//lists data tables and table state information. SHOW COLUMNS from Tbl_name [from Db_name]//List table fieldsSHOW fields from Tbl_name [from Db_name],describe tbl_name [Col_name]. SHOW full COLUMNS from Tbl_name [from db_name]//list fields and detailsSHOW full fields from Tbl_name [from Db_name]//list Field Full propertiesSHOW INDEX from Tbl_name [from Db_name]//lists the table indexes. SHOW STATUS//Lists the DB Server status. SHOW VARIABLES//lists the MySQL system environment variables. SHOW processlist//lists the execution commands. SHOW GRANTS for user//List A user right
$res = mysql_query ("SHOW full COLUMNS from table"); while ($row = mysql_fetch_array ($res)) { // echo ' field name: '. $row [' field ']. ' -Data type: '. $row [' type ']. ' -Note: '. $row [' Comment ']; Print_r ($row);}
MySQL view database, table, field information