You can make the first timestamp without autoupdating and a default value
with no importance... and the second with

DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

When you insert a new row.. .you'll use:
Asuming the table has columns: col1, ....., colN, col_timestamp1,
col_timestamp2
INSERT INTO table_name (col1, ....., colN, col_timestamp1) VALUES
('value_col1', ... 'value_colN', NOW())

This way the first TIMESTAMP column is registered with the
CURRENT_TIMESTAMP so is the second because the default value is also
CURRENT_TIMESTAMP.
But ... from now on for every change in the row only the second column will
change values !

--
Gabriel PREDA
Senior Web Developer


On 3/28/06, jonathan <[EMAIL PROTECTED]> wrote:
>
> Basically, I want to have a content row that has two times,  the time
> that an insert was done and the time that it was last updated if any.
> I keep getting an error when I try to create a table with two
> timestamp values (#1293 - Incorrect table definition; there can be
> only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON
> UPDATE clause).
> If I can have only one timestamp in the table, what is the ideal way
> to do this?
> thanks,
> jon

Reply via email to