<?php/*** 生成mysql資料字典 */
header("content-type:text/html;charset=utf-8");
//配置資料庫
$database = array
();$database['db_host'] = '119.23.140.154';
$database['db_name'] = 'haiyi';
$database['db_user'] = 'root';
$database['db_pwd'] = 'zpyxw5qxasel5atk';
$conn = mysqli_connect("", "", "", $database['db_name']);
if ($conn->connect_error)
mysqli_query("set names utf8");
$result = $conn->query('show tables', $mysql_conn
);if ($result->num_rows > 0) }//
迴圈取得所有表的備註及表中列訊息
foreach($tables
as$k => $v
)' and table_schema = ''";
$table_result = $conn->query($sql
);
while ($t = $table_result->fetch_array())
$sql = 'select * from ';
$sql .= 'information_schema.columns ';
$sql .= 'where ';
$sql .= "table_name = '' and table_schema = ''";
$fields = array
();
$field_result = $conn->query($sql
);
while ($t = $field_result->fetch_array())
$tables[$k]['column'] = $fields;}
$conn->close();
$html = '';
//迴圈所有表
//print_r($tables);
foreach($tables
as$k => $v
)
$html .= '';}
/*生成word
*///
//header ( "content-disposition:attachment;filename=資料字典.doc" );
/*生成excel
*///
//header ( "content-disposition:attachment;filename=資料字典.xls" );
// 輸出
echo '自動生成資料字典';
echo '';
echo
$html
;echo '總共:' . count($tables) . '個資料表
';echo '
';?>
php生成資料字典
生成mysql資料字典 配置資料庫 dbserver 127.0.0.1 dbusername 賬號 dbpassword 密碼 database 資料庫 其他配置 title 資料字典 mysql conn mysql connect dbserver dbusername dbpassword ...
php自動生成資料字典
生成mysql資料字典 配置資料庫 dbserver 127.0.0.1 dbusername 賬號 dbpassword 密碼 database 資料庫 其他配置 title 資料字典 mysql conn mysql connect dbserver dbusername dbpassword ...
sqlserver 生成資料字典
1,select obj.name as 表名,col.colorder as 序號 col.name as 列名 isnull ep.value as 列說明 t.name as 資料型別 col.length as 長度 isnull columnproperty col.id,col.name...