List:General Discussion« Previous MessageNext Message »
From:Hiep Nguyen Date:September 4 2007 7:01pm
Subject:timestamp for update and insert
View as plain text  
Hi list,

i tried to create a table with inserted & lastupdated timestamp fields:

create table temp (
id int not null primary ke auto_increment,
data varchar(100),
inserted timestamp default now(),
lastupdated timestamp(8));


how do i get mysql to put in the current timestamp for inserted & 
lastupdated fields when i insert a record and only lastupdated when i 
update the record?

thanks,
T. Hiep

Thread
timestamp for update and insertHiep Nguyen4 Sep
  • Re: timestamp for update and insertOlaf Stein4 Sep
    • Re: timestamp for update and insertMichael Dykman4 Sep
      • Re: timestamp for update and insertOlaf Stein4 Sep
      • Re: timestamp for update and insertHiep Nguyen4 Sep
        • Re: timestamp for update and insertMichael Dykman4 Sep
          • Re: timestamp for update and insertHiep Nguyen4 Sep
            • Re: timestamp for update and insertOlaf Stein4 Sep
  • RE: timestamp for update and insertDaevid Vincent4 Sep