I've been staring at this for ages and i cannot figure out what is wrong with this code
CREATE TABLE `faults` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`Reported_by` varchar(30) NOT NULL,
`Company` varchar(20) NOT NULL,
`Reporters_email` varchar(100) NOT NULL,
`Department` varchar(20) NOT NULL,
`Error_Detail` text,
`user_id` INT(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
CONSTRAINT `faults_fk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
the fault is on the last line
this is the error it gives me which isn't very helpful:
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 '' at line 11
can anybody spot my mistake??
faults(...REFERENCES 'users' ('id'));