
Originally Posted by
r937
one word: test database
That's two words where I come from.
couldn't resist 
anyway, I still get an error.
Code:
ALTER TABLE `business_type`
, DROP PRIMARY KEY
, ADD INDEX business_type_ix
, PRIMARY KEY (business_type,business_sub_type,business_category);
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' PRIMARY KEY (business_type,business_sub_type,business_category)' at line 4
I tried to do it with phpMyAdmin and was only able to create a unique index. when I then tried to remove the PK, it told me that I couldn't because there 'could only be one auto_increment column and it had to be the PK' (or words to that effect. Stands to reason I suppose.
And maybe I only need a unique index anyway? I am just trying to prevent duplicate entries and this has altered my table to createa unique index .
Code:
ALTER TABLE `tbl_business_type` ADD UNIQUE `business_type_ix` ( `business_type` , `business_sub_type` , `business_category` )
not much like the docs said it should be done.
bazz
Bookmarks