ThinkPHP5 动态创建数据表方法:
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); }
运行结果:
声明:本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ phpStudy 报 SMTP Error: Could not connect to SMTP host.错误的解决办法08/29
- ♥ ThinkPHP5 集成 PHPExcel 实现 excel 导入导出功能08/26
- ♥ Laravel 框架 Warning: require(../vendor/autoload.php): failed to open stream: No such file or directory in .../autoload.php on line 17 错误的解决办法08/25
- ♥ 在 Buyvm 的 VPS 上安装赠送的 DirectAdmin(以 Centos 7 为例)08/12
- ♥ 【疯狂猜成语/图猜成语】三个生字中间的生子下面是一个幸字是什么成语?08/22
- ♥ 口对号心错号是什么成语?08/23