Welcome Guest, Not a member yet? Register   Sign In
Cannot add or update a child row: a foreign key constraint fails
#1
Question 

I'm getting the following error when inserting data (through the required model) into our SQL database:
Cannot add or update a child row: a foreign key constraint fails (`scs`.`live_outputs`, CONSTRAINT `live_outputs_ibfk_1` FOREIGN KEY (`livestream_id`) REFERENCES `live_streams` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT)
I'm well aware what this means: that I'm referencing to non existing or incorrect data on the parent field (in this case the ID field of the live_streams table must match livestream_id). However I'm 100% sure that the ID submitted in the form is correct and matches the database:
[Image: 2ff]

As for the database:
[Image: 2fg]
Any suggestions as to what I might need to look at?
Reply


Messages In This Thread
Cannot add or update a child row: a foreign key constraint fails - by Sincere - 06-07-2022, 07:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB