xxreenaxx1 Posted January 29, 2011 Share Posted January 29, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/226057-fk-wont-work/ Share on other sites More sharing options...
nankoweap Posted January 30, 2011 Share Posted January 30, 2011 i don't believe foreign keys are supported in the myisam engine. you may want to consider using innodb instead. Quote Link to comment https://forums.phpfreaks.com/topic/226057-fk-wont-work/#findComment-1167215 Share on other sites More sharing options...
xxreenaxx1 Posted January 31, 2011 Author Share Posted January 31, 2011 I tired to view design and connected it that way Thanks though... Quote Link to comment https://forums.phpfreaks.com/topic/226057-fk-wont-work/#findComment-1167875 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.