违反完整性约束:cakephp

问题描述

我试图删除问题选项,但该问题 ID 属于其他表,但显示错误

错误sqlSTATE[23000]:违反完整性约束:1451 无法删除或更新父行:外键约束失败 (carbonate-staging.course_assesments_multiple_choices,CONSTRAINT A_q_Q_UID FOREIGN KEY ( question_id) 参考 course_assesment_questions (id) ON DELETE NO Action ON UPDATE NO ACT)

sql 查询:DELETE CourseAssesmentQuestion FROM carbonate-staging.course_assesment_questions AS CourseAssesmentQuestion LEFT JOIN carbonate-staging.courses AS Course ON (CourseAssesmentQuestion.course_id = Course.id) LEFT JOIN carbonate-staging.course_units AS CourseUnit ON ({{1} }.CourseAssesmentQuestion = course_unit_id.CourseUnit) WHERE id.CourseAssesmentQuestion = 601 AND NOT (course_id.CourseAssesmentQuestion = (第384章)

所以我只想在问题删除删除questios及其选择。请帮我解决这个问题。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)