Cannot add or update a child row: a foreign key constraint fails - when not all lookup table inputs
Re my app to create a list of industry updates, now built of course via DataAssist. (One table holds the industry updates; six lookup tables supply standard input items. Of course I can send a screen shot of theses tables in Workbench, if useful):
Insert works fine, and the result can later be found via Search - so long as all the items dependent on lookup tables are selected. But when I try to Insert - but without making a choice from all of the drop downs populated via the lookup tables - the error, in the browser, is of the type (one example):
Cannot add or update a child row: a foreign key constraint fails (`reglinktrial`.`industry_updates`, CONSTRAINT `fk_industry_updates_regions` FOREIGN KEY (`regions_idregion`) REFERENCES `regions` (`idregion`) ON DELETE NO ACTION ON UPDATE NO ACTION)
(In this case, the selection that was not made, causing the foreign key failure, is a 'region,' to go in the 'industry_update.')
Consistently, whatever lookup item has not had a selection becomes the foreign key constraint that causes failure. Perhaps it is worth noting that not filling in a field in the industry updates table, itself, causes no problem; the Insert sails through in that case.
Not every industry update to be Inserted will use all of the items from the lookup tables. Which is why this matters of course.
Is there some insight as to what is happening? And of course, a solution? I will post more detail if needed.