KEY is simply a synonym for INDEX (you do understand indexes, right?), whereas what kalon linked to was some generic stuff about primary and foreign keys, which doesn’t apply to the KEY you’re using
the error i am referring to is the one you posted, it is caused by something on the line immediately above the KEY line
more specifically (thanks, kalon) it is near COLOR=“Red”[/COLOR]
the error I got when I ran the script in SQLyog is
Query : CREATE TABLE orders( id INT UNSIGNED NOT NULL AUTO_INCREMENT, user_id INT UNSIGNED NOT NULL, transaction_id VARCHAR(1… Error Code : 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 '(id), KEY user_id (user_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8’ at line 8 Execution Time : 00:00:00:000 Transfer Time : 00:00:00:000 Total Time : 00:00:00:000