SLUG Mailing List Archives
Re: [SLUG] fustrations with mysql (TIMESTAMP)
- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] fustrations with mysql (TIMESTAMP)
- From: Tony Green <tgreen@xxxxxxxxxxx>
- Date: Tue Dec 17 15:51:05 2002
On Tue, 2002-12-17 at 15:21, Michael Fox wrote:
> I've been trying (keyword trying) to attempt to use a field in mysql to record
> the time at which a record is created in a table.
The TIMESTAMP column type provides a type that you can use to
automatically mark INSERT or UPDATE operations with the current date and
time. If you have multiple TIMESTAMP columns, only the first one is
Automatic updating of the first TIMESTAMP column occurs under any of the
* The column is not specified explicitly in an INSERT or LOAD DATA
* The column is not specified explicitly in an UPDATE statement
and some other column changes value. (Note that an UPDATE that
sets a column to the value it already has will not cause the
TIMESTAMP column to be updated, because if you set a column to
its current value, MySQL ignores the update for efficiency.)
* You explicitly set the TIMESTAMP column to NULL.
Hopefully this should help in your quest.