[Answer]-Mysql error 1452: can not add or update child rows, a foreign key constraint fails

1👍

If you insert or update a row on the first table the referenced address ID must exists on the second Table.

You can also add the following code to the foreign key constraint:

ON UPDATE CASCADE ON DELETE CASCADE

that means all modifications will be cascade to the child table

Leave a comment