public function ceshic(){ $sql = " CREATE TABLE IF NOT EXISTS `think_test`( `id` int(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci CHECKSUM=0 ROW_FORMAT=DYNAMIC DELAY_KEY_WRITE=0" ; Db::execute($sql); }
运行结果:
未经允许不得转载:吾爱主机之家 » ThinkPHP5动态创建数据表方法