[thelist] MySQL - column with default of NOW()

Warden, Matt mwarden at mattwarden.com
Fri Mar 8 18:32:01 CST 2002


hey folks,

in other databases it's legal syntax to set the default value of a column
to a constant or function that returns the current date and time. this
would be similar to MySQL's TIMESTAMP data type, except it wouldn't update
to the current date and time when the row is updated, only when it is
created without an explicit value.

I'd rather not have to explicitly set the field's value to NOW() every
time if I don't have to. Any ideas? I checked google and mysql.com and i
gots nuthin.

thanks,

--
mattwarden
mattwarden.com




More information about the thelist mailing list