http://www.sendspace.com/file/txjcvd
嗨,我是PHP/MySql的新手,试图创建一个包含25个项目的简单数据库: id、产品名称、产品价格和库存数量。
create table id(
id int(11) unsigned auto_increment primary key not null,
productname varchar(25) not null,
prodprice int(11) not null,
stockquant int(11) not null;
然而,我似乎不知道语法的哪一部分是错误的?
发布于 2013-11-11 19:26:50
create table id (
id int(11) unsigned auto_increment primary key not null,
productname varchar(25) not null,
prodprice int(11) not null,
stockquant int(11) not null
;之前不应该有a),以说明(在第一行id (?)之后)。(正如其他一些人所评论的那样)
create table id (
id int(11) unsigned auto_increment primary key not null,
productname varchar(25) not null,
prodprice int(11) not null,
stockquant int(11) not null
);发布于 2013-11-11 19:30:18
它缺少结尾处的括号。通过它,该语句工作得很好:
mysql>
CREATE TABLE id(
id INT(11) unsigned auto_increment PRIMARY KEY NOT NULL,
productname varchar(25) NOT NULL,
prodprice INT(11) NOT NULL,
stockquant INT(11) NOT NULL
);Query OK, 0 rows affected (0.02 sec)https://stackoverflow.com/questions/19914143
复制相似问题