ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
db\_table\_create\_sql() - 获得数据表的序列化结构 ### 说明 ~~~ db_table_create_sql($schema) ~~~ ### 参数 * **$schema**创建数据表所需要各项参数 ### 示例 ~~~ $id = array('type' => 'id', 'default' => 12, 'increment' => 'AUTO_INCREMENT');$sex = array('type' => 'sex', 'default' => 1);$age = array('type' => 'age', 'default' => 0);$index = array('fields' => array('id'), 'type' => 'primary');echo db_table_create_sql(array('tablename' => 'zefeng', 'fields' => array($id, $sex, $age), 'indexes' => array($index), 'engine' => 'InnoDB', 'charset' => 'utf8'));//CREATE TABLE IF NOT EXISTS `zefeng` ( `` id unsigned NOT NULL DEFAULT '12' AUTO_INCREMENT, `` sex unsigned NOT NULL DEFAULT '1', `` age unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ~~~