开发者

Foreign Key Constraint fail

开发者 https://www.devze.com 2023-04-08 05:56 出处:网络
I\'m trying to insert a new row in the table bu开发者_开发问答t I\'m getting below error: Cannot add or update a child row: a foreign key constraint fails (`wmetools_restool_dev/keywords`, CONSTRAINT

I'm trying to insert a new row in the table bu开发者_开发问答t I'm getting below error:

Cannot add or update a child row: a foreign key constraint fails (`wmetools_restool_dev/keywords`, CONSTRAINT `keywords_ibfk_1` FOREIGN KEY (`link_id`) REFERENCES `links` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I have supplied all the fields required. Does it mean I need to insert more fields?


The table has a foreign key contraint to another table called links. You have to first insert a row in the links table with the correct link_id before you can insert the row into your table.

0

精彩评论

暂无评论...
验证码 换一张
取 消