sql - 1452 mysql error occurs when I do multiple primary key mapping to single foreign key -
sql - 1452 mysql error occurs when I do multiple primary key mapping to single foreign key -
this query.
create table tbl_user_role ( userid int(11), roleid int(11), primary key (userid, roleid), foreign key (userid) references tbl_user(userid) on delete cascade on update cascade, foreign key (userid) references tbl_faculty(facultycode) on delete cascade on update cascade, foreign key (userid) references tbl_student(studentrollno) on delete cascade on update cascade ) engine=innodb;
when add together record through form, give me error "cannot add together or update kid row: foreign key constraint fails".
mysql sql database
Comments
Post a Comment