我创建了vqmod
$this->db->query("CREATE TABLE IF NOT EXISTS `continents` (
`continents_id` int(11) NOT NULL AUTO_INCREMENT,
`continents_name` varchar(255) NOT NULL,
`status` tinyint(4) NOT NULL,
PRIMARY KEY (`continents_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8");
$rec = $this->db->query("SELECT * FROM " . DB_PREFIX . "continents");
if(count($rec) == 0) {
$this->db->query("INSERT INTO " . DB_PREFIX . "continents(continents_id,continents_name,status) VALUES(1, 'Asia', 1),(2, 'Africa', 1),(3, 'North America', 1),(4, 'South America', 1),(5, 'Antarctica', 1),(6, 'Europe', 1),(7, 'Australia', 1)");
}
使用此代码表可以创建,但不会像我的代码那样填充表中的数据。