I have a table RESERVATIONS, which has these Constraints:
CONSTRAINT `reservations_customerID` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`customer_id`),
CONSTRAINT `reservations_eventID` FOREIGN KEY (`event_id`) REFERENCES `events` (`event_id`),
CONSTRAINT `reservations_hotelID` FOREIGN KEY (`hotel_id`) REFERENCES `hotels` (`hotel_id`)
For some reason, this INSERT SUCCEEDS:
INSERT INTO reservations (hotel_id, customer_id) VALUES (111,222)
While this INSERT FAILS:
INSERT INTO reservations (hotel_id, event_id, customer_id) VALUES (111,222,333)
With the following error message:
"Cannot add or update a child row: a foreign key constraint fails ('turon/reservations', CONSTRAINT 'reservations_eventID' FOREIGN KEY ('event_id') REFERENCES 'events' ('event_id'))
As far as I can tell all constraints are similar.
Any suggestions?
Thanks,
Michael