gpt4 book ai didi

mysql - 无法添加或更新子行外键约束失败

转载 作者:行者123 更新时间:2023-12-02 15:03:30 24 4
gpt4 key购买 nike

<分区>

1452 - 无法添加或更新子行:外键约束失败(projectphp1707#sql-e6c_cd,CONSTRAINT #sql-e6c_cd_ibfk_1 外键 (order_id) 引用 tbl_order (order_id))

表一: enter image description here

表 2: enter image description here

CREATE TABLE `tbl_order` (
`order_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`cus_fullname` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`total_price` double DEFAULT NULL,
`active` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE `tbl_payment` (
`pay_id` int(50) NOT NULL,
`pro_id` int(15) NOT NULL,
`pay_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`pay_email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`pay_adress` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`pay_cardname` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`pay_cvc` int(3) NOT NULL,
`pay_number` text COLLATE utf32_unicode_ci NOT NULL,
`pay_mm` int(2) NOT NULL,
`pay_yyyy` int(4) NOT NULL,
`pay_totals` varchar(255) COLLATE utf32_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_unicode_ci;

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