$sql = "
SELECT
COLUMNS.TABLE_NAME, COLUMNS.COLUMN_DEFAULT, COLUMNS.ORDINAL_POSITION, COLUMNS.COLUMN_NAME, COLUMNS.COLUMN_TYPE, COLUMNS.COLUMN_KEY, COLUMNS.EXTRA, COLUMNS.COLUMN_COMMENT, TABLES.TABLE_COMMENT
FROM
information_schema.COLUMNS
LEFT JOIN information_schema.TABLES ON TABLES.TABLE_NAME = COLUMNS.TABLE_NAME
WHERE
COLUMNS.TABLE_SCHEMA = '{$dbname}'
";

posted on 2011-09-30 21:52  龙翔吟  阅读(257)  评论(0编辑  收藏  举报