Hello.
I do not require this error to be solved. I just need to understand what it means so I can approach it myself.
Cannot add or update a child row: a foreign key constraint fails
(`db`.`transaction`, CONSTRAINT `transaction_ibfk_2`
FOREIGN KEY (`product_id`) REFERENCES `product` (`id`))
INSERT INTO `transaction` ( `client_id`, `cost`, `website_id`, `product_id`,
`template_number`, `value`, `order_id` )
VALUES ( '17', '', '2480', '', '', '12', '1');
What is a foreign key? How is it set?
What does CONSTRAINT transaction_ibfk_2
mean?
Does this mean I need to have a table called transaction_ibfk_2
?
Thanks.