Monday, 6 July 2020

Automatically insert row in mysql every month

You can try this code: 

CREATE EVENT event_add_interest
ON SCHEDULE EVERY 1 MONTH STARTS LAST_DAY(CURDATE())
DO
INSERTINTOtransaction
SELECT id, balance
FROM clientInfo;

 Use SET GLOBAL event_scheduler = ON;to enable the scheduler if it's currently not enabled. More on configuring event scheduler here

No comments:

Post a Comment