Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Rick James for Mysql query - Event to delete rows by its value

To fix the syntax error:

DELETE FROM events WHERE check_in < (NOW() - INTERVAL 1 DAY)

That won't land on midnight. Instead change to:

DELETE FROM events WHERE check_in < CURDATE() - INTERVAL 1 DAY

Give writing the EVENT a try.

Be sure to do (once):

SET event_scheduler = ON;

Viewing all articles
Browse latest Browse all 3

Trending Articles