各位帮忙修改一下这段代码
我找不出来错误CREATE tabale 'Books' `$tabale` ('ChapterId' int(20) auto_increment,
'ChapterName' varchar(50) not null unique,
'ChapterUrl' varchar(50) not null unique,
'PlBookId' int(20) not null,
PRIMARY KEY ('ChapterId'),
FOREIGN KEY ('PlBookId') REFERENCES book('BookId')
)ENGINE = MYISAM
我找不出来错误CREATE tabale 'Books' `$tabale` ('ChapterId' int(20) auto_increment,
'ChapterName' varchar(50) not null unique,
'ChapterUrl' varchar(50) not null unique,
'PlBookId' int(20) not null,
PRIMARY KEY ('ChapterId'),
FOREIGN KEY ('PlBookId') REFERENCES book('BookId')
)ENGINE = MYISAM
还有表名,字段名一般都不用''这样的吧
#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 'Books' 'asdfsadfa' ( 'ChapterId' int(20) not null auto_incre' at line 1
tabale这种错误太低级了。
'ChapterId'INT( 20 ) AUTO_INCREMENT ,
'ChapterName'VARCHAR( 50 ) NOT NULL UNIQUE ,
'ChapterUrl'VARCHAR( 50 ) NOT NULL UNIQUE ,
'PlBookId'INT( 20 ) NOT NULL ,
PRIMARY KEY ( 'ChapterId' ) ,
FOREIGN KEY ( 'PlBookId' ) REFERENCES book( 'BookId' )
) ENGINE = MYISAM
也报错误
#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 ''Books' 'dsfsadfa'( 'ChapterId' INT( 20 ) AUTO_INCREMENT , 'ChapterName'VARCHA' at line 1