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:$query = "DELETE sections,cpicks FROM sections INNER JOIN cpicks ON cpicks.section_id = sections.id WHERE sections.id = ".$sectionID."";
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.