Last post Oct 18, 2019 06:20 AM by kengkit
Oct 18, 2019 06:20 AM|kengkit|LINK
Hi guys. I wanna create a recurring event (every 15minutes) in MySQL Database to delete transaction which is status = 'Pending' and created_date is <= current DateTime.
Below is my sql statement. Is every looked fine?
CREATE EVENT hotelBookingEvent
ON SCHEDULE EVERY 15 MINUTE
ENDS CURRENT_TIMESTAMP + INTERVAL 9999 HOUR
DELETE FROM room_booking WHERE ROUND(TIME_TO_SEC(TIMEDIFF(created_date, now())) / 60) <= -15 AND status = 'Pending'
SET GLOBAL event_scheduler = ON;