Mysql Trigger With example Code

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 here

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s