我正在使用laravel 5框架。
完整性约束违规:1452无法添加或更新子行:外键约束失败(
database_name
。students
,CONSTRAINTstudents_ibfk_1
FOREIGN KEY(stu_id
)参考admission_details
(ad_id
))
答案 0 :(得分:0)
在phpmyadmin中运行此查询
ADD CONSTRAINT `students_ibfk_1` FOREIGN KEY (`type_id`) REFERENCES `admission_details`(`ad_id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
希望它对你有帮助