just found something on google:
"In general, this cannot be done. Default values cannot be the return of
MySQL function (as much as I'd love to use NOW() for default values!).
However, there's one loophole. When inserting, not specifying a value
the first timestamp field in a table will generate the current
Best work around I can think of is to set your field as an int
and include unix_timestamp(NOW()) in your inserts
From: Nicolas Verhaeghe [mailto:nicolas@stripped]
Sent: Wednesday, May 10, 2006 2:33 PM
Subject: Can I set UNIX_TIMESTAMP() as default?
I would like an integer field to capture the current date as a Unix
Timestamp by default.
But this will not be accepted at all.
I get the error "invalid default value for [field name]"
Is there a workaround?
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql