createtableorder->(idint(10)unsignednotnullauto_increment,->bookidint(10)unsignednotnulldefault'0',->useridint(10)unsignednotnulldefault'0',->numbertinyint(3)unsignednotn...
create table order
-> (id int(10) unsigned not null auto_increment,
-> bookid int(10) unsigned not null default '0',
-> userid int(10) unsigned not null default '0',
-> number tinyint(3) unsigned not null default '0',
-> address varchar(128) not null default '',
-> postcode varchar(6) not null default '',
-> orderdate datetime not null default '0000-00-00 00:00:00',
-> status tinyint(3) unsigned zerofill not null default '000',
-> primary key(id),
-> key fk_order_1 (bookid),
-> key fk_order_2 (userid),
-> constraint fk_order_1 foreign key (bookid) references bookinfo (id),
-> constraint fk_order_2 foreign key (userid) references userinfo (id))
-> ;
1064 - 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 'create table order
(id int(10) unsigned not null auto_increment,
bookid ' at line 3
展开