List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 12 2002 6:15pm
Subject:Re: Table with creattime and modtime columns-how to?
View as plain text  
At 11:10 -0700 6/12/02, pixelandink.com wrote:
>Hello,
>
>How does one create a MySQL table with a columns named something 
>like "creattime" and  "modtime" where the creattime value for a 
>record is set to the current time when the record is created and the 
>modtime value for a record is set to the current time whenever the 
>record is modified?

Use two TIMESTAMP fields.  The first one must be the modtime field and
the second will be the createtime field.  Set them both to NULL when
the record is created.  Don't set either when you modify the record.

>Thanks,
>David Franzen

Thread
Table with creattime and modtime columns-how to?pixelandink . com12 Jun
  • Re: Table with creattime and modtime columns-how to?Paul DuBois12 Jun