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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -