// 增加字段
$sql="alter table libai_phone_user add sourcem VARCHAR(255) NOT NULL DEFAULT 0 comment '来源' ";
// 建表
$sql="CREATE TABLE IF NOT EXISTS `libai_bank_record`(
`id` INT UNSIGNED AUTO_INCREMENT,
`uid` INT NOT NULL,
`q_id` INT NOT NULL,
`submission_date` DATE,
PRIMARY KEY ( `id` )
)ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;";
$result = Db::execute($sql);
if($result ){
echo"字段增加成功";
}else{
echo "字段增加失败";
}
ThinkPHP 新建数据表
最新推荐文章于 2024-06-13 08:42:35 发布