Mysql多个时间戳列更新

Consider this:

    +---------------+--------------+------+-----+-------------------+-----------------------------+
    | Field         | Type         | Null | Key | Default           | Extra                               |
    +---------------+--------------+------+-----+-------------------+-----------------------------+
    | email_address | varchar(100) | NO   | PRI | NULL              |                             |
    | create_date   | timestamp    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
    | optin_date    | timestamp    | YES  |     | NULL              |                             |
    | optout_date   | timestamp    | YES  |     | NULL              |                             |
    +---------------+--------------+------+-----+-------------------+-----------------------------+

Using PHP, how can I make the optin_date and optout_date columns store the current timestamp?

You can have only one current_timestamp column. For the second you have to use trigger on insert/update.

http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html