This can be done using the 'timestamp' type for your column. Note that
this field will be updated to the current time any time the row is
modified (including when it is created).

An alternative is to do it on the scripting side with the MySQL NOW()
command like so:

INSERT INTO your_table (field1,field2,...,create_date) values(

The create_date field can be of type time, date, or datetime. I
recommend datetime.


On Tue, 2002-12-17 at 22:22, Michael Zornek wrote:
> I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
> question regarding MySQL.
> In Access one can create a date field and set the default to "Date()" to get
> the current date but according to the mysql manual:
> > Default values must be constants. This means, for example, that you cannot set
> > the default for a date column to be the value of a function such as NOW() or
> Is there any other way to have MySQL automate this? I've heard of something
> called stored procedures but am unfamiliar. -- Must this be done on the
> scripting side?
> Thanks,
> ~ Mike
> -- 
> New blog, new Q&A column, new content everywhere!
> -- 
> PHP Database Mailing List (
> To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to