2014-11-05 68 views
-2

我创建了一个nfl团队的数据库。我创建了一个名为玩家持有BIOS信息的表格。现在我想创建一个名为“交易”的表格,其中显示了交易交易,但玩家根据玩家的主要关键字选择了主动名单。但我不断收到此错误:ERROR 1064 (42000): 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 'KEY(idplayer) REFERENCES players(playersid))' at line 8. `我不断收到这个错误在mysql

create table transactions(
transid INT UNSIGNED NOT NULL AUTO_INCREMENT, 
type VARCHAR(30), 
fromteam VARCHAR(30), 
toteam VARCHAR(30), 
idplayer INT UNSIGNED NOT NULL, 
PRIMARY KEY(transid), 
FORIEGN KEY(idplayer) REFERENCES players(playersid)); 

请会有人帮我类似的经历。

+0

检查外键拼写 – Anptk 2014-11-05 11:00:07

+0

这是'FOREIGN'而不是'FORIEGN' – 2014-11-05 11:00:16

+0

错字错误:其FOREIGN KEY不是FORIEGN KEY – ekans 2014-11-05 11:00:29

回答

0

错字,改变

 FORIEGN KEY(idplayer) REFERENCES players(playersid)); 

 FOREIGN KEY(idplayer) REFERENCES players(playersid)); 
相关问题