Prova att skapa ett event som pågår varje dag som nedan
CREATE EVENT myevent
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO
UPDATE my_table SET status ='closed'
WHERE post_date > DATE_ADD(now(), INTERVAL -30 DAY)
AND status='open'
-- Uppdatera Ändrad syntax
CREATE EVENT myevent
ON SCHEDULE EVERY 24 HOUR
DO
UPDATE my_table SET status ='closed'
WHERE post_date > DATE_ADD(now(), INTERVAL -30 DAY)
AND status='open'