MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Bob Afifi Date:February 10 2004 7:55pm
Subject:Adding NOW() to existing INSERT statement?
View as plain text  
I'm trying to get a fixed entry date using two
DATETIME fields (dt_update, dt_create). 
The first DATETIME field (dt_update)
automatically updates each time the record is 
modified, the second DATETIME field (dt_create)
doesn't. 

I've been able to get it using this: 

INSERT INTO `test` SET dt_create = NOW() 

However, what I really need is to have the above
INSERT statement (or something that 
does the same thing) integrated into another
INSERT statement which looks 
something like this: 

INSERT INTO `test` (`Title`, `Email`, `City`,
`State`, `Country`, `URL`, `Date`, 
`Description`, `rid`) VALUES ('Widget',
'widget@stripped', 'Glendale', 'CA', 'USA ', 
'http://www.widget.com', 'Tuesday, February 10,
2004 ', 'Widgets for sale', '') 

Anybody know how to do this? 

Many thanks in advance, 

-Bob 



__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
Thread
Adding NOW() to existing INSERT statement?Bob Afifi10 Feb
  • Re: Adding NOW() to existing INSERT statement?mos10 Feb
  • Re: Adding NOW() to existing INSERT statement?Bob Afifi11 Feb