为什么我不能在我的付款表中创建外键。
crate table students(
text char(5)NOT NULL,
id int(11)NOT NULL AUTO_INCREMENT,
name varchar(250),
level varchar(250),
PRIMARY KEY (text,id)
)ENGINE=MyISAM;
订单表是
crate table payments(
p_id int(11)NOT NULL AUTO_INCREMENT,
amount varchar(250),
id int
PRIMARY KEY (p_id)
FOREIGN KEY (id) REFERENCES students(id)
)ENGINE=MyISAM;