Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • i tried it and its same Error 1452: Cannot add or update a child row: a foreign key constraint fails (`Todo`.`todos`, CONSTRAINT `fk_users_todo_list` FOREIGN KEY (`fk_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) [1.267ms] [rows:0] INSERT INTO `todos` (`created_at`,`updated_at`,`deleted_at`,`name`,`description`,`status`,`fk_id`) VALUES ('2022-03-03 12:17:38.649','2022-03-03 12:17:38.649',NULL,'my first todo','Test description','2',0) ON DUPLICATE KEY UPDATE `fk_id`=VALUES(`fk_id`) this is the full error. Commented Mar 3, 2022 at 8:50