The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

#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 .

as for two columns in the same row called "type" and "subtype", you may want to rethink this

you're embedding a relationship (between type and subtype) into a third table, and you're leaving open the possibility that row can reference a type and subtype that aren't actually related to each other

better to link just to the (sub)type, and have the (sub)type link to its (super)type

I won't need the auto_increment in the end. But for now, and until I get my head around the alternative, I do need it. By alternative I mean where the three fields are normalised throughout the table and have PK/FK relationships within the table. (I'm sure there's a name for dat).