A
Anonymous
Guest
Hello,
I have two tables with a foreign key in the child table (sections : cpicks / 1: n)
I tried to delete section entries and dependent cpicks entries like that:
However I still receive this message:
What is the reason here? Thanks.
I have two tables with a foreign key in the child table (sections : cpicks / 1: n)
I tried to delete section entries and dependent cpicks entries like that:
$query = "DELETE sections,cpicks FROM sections INNER JOIN cpicks ON cpicks.section_id = sections.id WHERE sections.id = ".$sectionID."";
However I still receive this message:
Unable to execute query. Cannot delete or update a parent row: a foreign key constraint fails (`cherrypics-3133335250`.`cpicks`, CONSTRAINT `cpicks_ibfk_1` FOREIGN KEY (`section_id`) REFERENCES `sections` (`id`))
What is the reason here? Thanks.