各位救命啊!!!!!!在系统里面需要为每个用户创建一个独立的数据库,sql语句如下
CREATE DATABASE dbq7 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use dbq7;
CREATE TABLE userinfo
(
id int(11) NOT NULL AUTO_INCREMENT,
UserName varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (id)
)
ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=gb2312;上面的语句用execute执行就出错,直接在mysql命令下执行不会出现错误。出错说
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use dbq7;CREATE TABLE userinfo (id int(11) NOT NULL AUTO_INCREMENT,UserName varc' at line 1本人估计是use dbq7一行执行不了
CREATE DATABASE dbq7 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use dbq7;
CREATE TABLE userinfo
(
id int(11) NOT NULL AUTO_INCREMENT,
UserName varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (id)
)
ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=gb2312;上面的语句用execute执行就出错,直接在mysql命令下执行不会出现错误。出错说
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'use dbq7;CREATE TABLE userinfo (id int(11) NOT NULL AUTO_INCREMENT,UserName varc' at line 1本人估计是use dbq7一行执行不了
use dbq7;
CREATE TABLE userinfo
(
id int(11) NOT NULL AUTO_INCREMENT,
UserName varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (id)
)
ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=gb2312;
");