Hello i want to make unique key as a foreign key but i got an error i already checked this questionthis question
mY member Table
CREATE TABLE IF NOT EXISTS `member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`contact` varchar(100) NOT NULL,
`facebook` varchar(100) NOT NULL,
`cnic` varchar(100) NOT NULL,
`expertise` varchar(100) NOT NULL,
`com_code` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB
and my profile image tabl
create table profileimage(
imageid int primary key not null,
username varchar(100) foreign key references member(username)
ON DELETE CASCADE
ON UPDATE CASCADE,
imagepath varchar(255) not null
);
and error i faced #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 'foreign key references member(username) ON DELETE CASCADE ON UPDATE CASCADE,' at line 6