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? Quote Link to comment 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. Quote Link to comment 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.