In Here a practical example of trigger in MySQL showed,just copy and
save the code as any_name.sql and import it to any of your database.
there is a table called [timetest].
the case :
when user update status 1 ,
then a trigger execute,which update the activation date and with
length of the expire date.
—when status is 0,no act date or expire date
–when update status from 0 to 1,then act date update also exp date
update with the len column.
the sql file code is below: