mannyee Posted March 19, 2010 Share Posted March 19, 2010 hi guys!! while going thru a tutorial on php-mysql, i came across the following query: CREATE TABLE IF NOT EXISTS `tbl_category` ( `cat_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cat_parent_id` int(11) NOT NULL DEFAULT '0', `cat_name` varchar(50) NOT NULL DEFAULT '', `cat_description` varchar(200) NOT NULL DEFAULT '', `cat_image` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`cat_id`), KEY `cat_parent_id` (`cat_parent_id`), KEY `cat_name` (`cat_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; Here, i am a bit confused about the term KEY..... what's it purpose? Is the author trying to create a foreign key?? If yes, then the table should have been INNODB......isn'it? Link to comment https://forums.phpfreaks.com/topic/195830-foreign-keys/ Share on other sites More sharing options...
fenway Posted March 22, 2010 Share Posted March 22, 2010 One quick look at the manual for CREATE TABLE will tell you exactly what's going on here. Link to comment https://forums.phpfreaks.com/topic/195830-foreign-keys/#findComment-1030185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.