I have a problem, it turns out that I am learning to create Trigger in mysql but I can not find the way I need it.
I have this table, which is filled with records every day with more frequency in the mornings.
I need to create a Trigger that updates the status to 2 when the current date is greater than reservation_date (datetime) and the current time is greater than reservation_time (time).
I thought that this event could be run every time there is a new record in the table. I do not know if it's right.
CREATE TRIGGER upd_stado AFTER INSERT FOR EACH ROW UPDATE SET estado =
2 WHERE datetime() > fecha_reserva && date() > hora_reserva;
The truth is that I am learning and I would like help in the Query.
Thank you.