MySQL Forums
Forum List  »  PHP

Re: DATE problem
Posted by: Gregory Rafuse
Date: August 25, 2005 01:40PM

There's also a differnt way to set up a field type to automatically update with the current timestamp. Set up a timestamp type field this way:

CREATE TABLE blah (
...
`lastupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
...
);

Each time a record is added to the table, this column is automagically updated with the current system timestamp in YYYY-MM-DD format, unless you have the default system format changed to something else.

Greg

Options: ReplyQuote


Subject
Written By
Posted
August 22, 2005 04:20PM
August 23, 2005 08:10AM
Re: DATE problem
August 25, 2005 01:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.