Jump to content

FK wont work!


xxreenaxx1

Recommended Posts

I tired to create table that has a foreign key but it wont let me create it

CREATE TABLE IF NOT EXISTS `user` (
  `Use_ID` int(11) NOT NULL AUTO_INCREMENT,
  `Use_Name` varchar(20) NOT NULL,
  `Use_Password` varchar(20) NOT NULL,
  `Rol_ID` int(11) NOT NULL,
  PRIMARY KEY (`Use_ID`),
  KEY `Rol_ID` (`Rol_ID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

KEY 'Rol_ID'('Rol_ID') this is the foreign key. But I am not sure why its saying KEY. And when I view the design no tables are linked together.

Link to comment
https://forums.phpfreaks.com/topic/226057-fk-wont-work/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.