$this->dc=[
'DB_TYPE'=> 'mysql',
'DB_HOST'=> '127.0.0.1',
'DB_NAME'=> 'shujuku',
'DB_USER'=> 'root',
'DB_PWD'=> '******',
'DB_PORT'=> '3306',
'DB_PREFIX'=> 'ceshi_',
'DB_CHARSET'=> 'utf8'
];
$type='cc';
$id='1';
$sql ="CREATE TABLE `ceshi_".$type."_".$id."` (";
$sql.="`id` int(10) NOT NULL AUTO_INCREMENT,";
$sql.="`z1` float(10,2) NOT NULL COMMENT '字段1',";
$sql.="`z2` varchar(5) DEFAULT NULL COMMENT '字段2',";
$sql.="`z3` float(20,8) DEFAULT NULL,";
$sql.="`z4` int(10) NOT NULL DEFAULT '0' COMMENT '字段4',";
$sql.="`z5` float(20,6) NOT NULL COMMENT '字段5',";
$sql.="PRIMARY KEY (`id`)";
$sql.=") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='表注释'";
M('','',$this->dc)->execute($sql);
|