ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
db\_table\_schema() - 获得某个数据表的结构 ### 说明 ~~~ db_table_schema($db, $tablename = '') ~~~ ### 参数 * **$db**数据库操作对象 * **$tablename**表名 ### 示例 ~~~ $scahema = db_table_schema(pdo(), 'article_category');print_r($scahema);Array ( 'tablename' => ims_article_category, //表名 'charset' => utf8_general_ci, //字符集 'engine' => MyISAM, //存储引擎 'increment' => 1, //下一个自增值 'fields' => Array ( //字段结构 'id' => Array ( 'name' => id, //字段id 'type' => int, //字段类型 'length' => 10, //字段长度 'null' => 'signed' => 'increment' => 1 //自增1 ), 'title' => Array ( 'name' => title, 'type' => varchar, 'length' => 30, 'null' => 'signed' => 1, 'increment' => ), 'displayorder' => Array ( 'name' => displayorder, 'type' => tinyint, 'length' => 3, 'null' => 'signed' => 'increment' => ), 'type' => Array ( 'name' => type, 'type' => varchar, 'length' => 15, 'null' => 'signed' => 1, 'increment' => ) ), 'indexes' => Array ( 'PRIMARY' => Array ( 'name' => PRIMARY, 'type' => primary, 'fields' => Array ( '0' => id ) //主键索引id ), 'type' => Array ( 'name' => type, 'type' => index, 'fields' => Array ( '0' => type ) //唯一索引type ) )) ~~~