mysqlデータベースのすべてのテーブル名とフィールドコメントを取得
986 ワード
1、フィールドコメントを取る
2、取得表注記
mysqlマニュアル:23.1.INFORMATION_SCHEMAテーブル3、あるデータベースの下のすべてのテーブルのコメントを取得する
自己付加価値ALTER TABLE[Table]members AUTO_の更新INCREMENT=10000
Select COLUMN_NAME , DATA_TYPE , COLUMN_COMMENT
from INFORMATION_SCHEMA.COLUMNS
Where table_name = 'companies'##
AND table_schema = 'testhuicard'##
AND column_name LIKE 'c_name'##
2、取得表注記
Select table_name ,TABLE_COMMENT from INFORMATION_SCHEMA.TABLES Where table_schema = 'testhuicard' ##
AND table_name LIKE 'companies'##
mysqlマニュアル:23.1.INFORMATION_SCHEMAテーブル3、あるデータベースの下のすべてのテーブルのコメントを取得する
$tt = mysql_query("show table status;");
$table_info=array();
while($re = mysql_fetch_array($tt,MYSQL_ASSOC)){
//$re["Comment"],
$table_info[] = $re;
} ......
自己付加価値ALTER TABLE[Table]members AUTO_の更新INCREMENT=10000