I have this error: “MySqlException: Cannot add or update a child row: a foreign_key constraint fails” on my C# project, when executing this code:
INSERT INTO networks (owner_name, name, password, ip, visible) VALUES ('alex', 'alex_net', '1234', '192.168.1.1', 1) ON DUPLICATE KEY UPDATE name='alex_red', password = '1234', ip = '192.168.1.1', visible = 1
But when I execute it on PhPMyAdmin it works perfectly.
Why does it fail on the aplication but works on PhPMyAdmin?