gpt4 book ai didi

php - 外键约束失败

转载 作者:行者123 更新时间:2023-11-29 02:05:13 25 4
gpt4 key购买 nike

我试图在表格中插入一个新行,但出现以下错误:

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)

我已经提供了所有需要的字段。这是否意味着我需要插入更多字段?

最佳答案

表格有一个foreign key contraint到另一个名为 links 的表。您必须先使用正确的 link_idlinks 表中插入一行,然后才能将行插入到您的表中。

关于php - 外键约束失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7590240/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com