This is the way to perform a trigger that removes data from my database that is less than 24 hours.
I have the following table of reservations and in this I add a field 'Type' that can be permanent or by hours, if it is by hours it will be eliminated in 24 hours.
CREATE TABLE IF NOT EXISTS 'Inv_Reserva' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'Item' varchar(50) NOT NULL,
'CodPza' varchar(45) DEFAULT NULL,
'Tipo' varchar(45) NOT NULL,
'timestamp' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=246 ;
For the date field I use timestamp
since I save the date and time.
In my trigger I would first ask you to find the data with Tipo
Hour "DELETE FROM Inv_Reserva WHERE Tipo='Hora'"
I hope to have explained myself well.