Hey,
I have two columns. Ride and booking.
In table booking there is the foreign key of ride.
The intention is that 30-day and later bookings will be removed.
If I run this query, I get the error message: mysql 1451 can not delete or update a parent row
The query is:
DELETE FROM booking WHERE DATEDIFF(NOW() ,Date )>30;
I searched the Internet and found this solution:
SET foreign_key_checks = 0;
DELETE FROM booking WHERE DATEDIFF(NOW() ,Date )>30;
SET foreign_key_checks = 1;
The second query does work,
My question is: Is there another way to remove bookings?
thanks in advance