Hello,
I have a rather easy question, but for some reason I can't figure it out.
What I want is a column that will indicate when the record was added, but
not when it was modified. I know a timestamp column will do the first half
of the trick, but not the other half.
The prefect solution would be to set the default of a datetime column to
whatever NOW() returns, but that doesn't seem to work as when I try to set
the default, it changes the string 'NOW()' to '0000-00-00 00:00:00'.

Is it possible to set the column's default to a function ?

A dirty solution would be to create 2 timestamp columns, so only the first
one would get updated when the record gets modified, but I didn't get a
chance to try that.

Any thoughts, comments ?

Thanks in advance

Pawel

P.S. just to make the filter happy:
database,sql,query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to