I am creating a table where it has a foreign key so that it would be linked to another table, but it kept me giving this error, I already checked the syntax on w3schools, but I still keep getting errors any idea why? here's my SQL script
CREATE TABLE user_profile
(
user_Id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
accnt_id INT,
first_name varchar(255),
last_name varchar(255),
biography TEXT,
date_joined DATETIME,
date_of_birth DATE,
email varchar(255),
gender varchar(255),
screenname varchar(255)
country varchar(255),
FOREIGN KEY (accnt_Id) REFERENCES accounts(accnt_Id)
)
Here's the 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 'country varchar(255), FOREIGN KEY (accnt_Id) REFERENCES accounts(accnt_Id) )' at line 13
accnts_Idfield. b. both the tables have InnoDB engine?