i am getting this error
Food Item Insertion FailedCannot add or update a child row: a foreign key constraint fails (menu_manager
.recipe_ingredient
, CONSTRAINT recipe_ingredient_ibfk_1
FOREIGN KEY (recipe_id
) REFERENCES recipe
(recipe_id
) ON UPDATE CASCADE)
i am trying to add recipe to my database in one form. and i want the data entered to go to 3 different table. ingredient table recipe table and the recipe_ingredient table. the recipe table has an auto increment id as primary key and the ingredient_id as a foreign key in the recipe table.
i want the ingredient name, data to go to the ingredient table and the name, course, instruction to the recipe table plus the ingredient_id in the recipe table
the the ingredient quantity and unit to go to the ingredient_recipe table which is refferencing the ingredient_id and the recipe_id.
i get the error:
Food Item Insertion FailedCannot add or update a child row: a foreign key constraint fails (menu_manager
.recipe_ingredient
, CONSTRAINT recipe_ingredient_ibfk_1
FOREIGN KEY (recipe_id
) REFERENCES recipe
(recipe_id
) ON UPDATE CASCADE)
thanks in advance for the help guys