Msg#: 4371259 posted 9:53 pm on Oct 5, 2011 (gmt 0)
I have two tables within a database.
The first is 'clicks'
It has four fields: Name: fil_id type: int(10) PRIMARY KEY
Name: customer_id type: int(4)
Name:location Type: varchar(100)
Name: uniqid Type: varchar(15)
The second table is 'downloads'
It has two fields:
Name: customer_id Type: int(4) PRIMARY KEY
Name: username Type: varchar(35)
When I run the following SQL in phpmyadmin
ALTER TABLE clicks ADD FOREIGN KEY (customer_id) REFERENCES downloads(customer_id) SHOW ERRORS
I get an error #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 'SHOW ERRORS' at line 1
I've looked at this one quite intensively. As the tables hold no data I could just drop them and recreate, including the foreign key. But I would like to nail the problem and I just can't figure it. Can you help?
I am running MySQL 5.07 locally on my Windows 7 PC.