So sprach chris am Tue, Apr 02, 2002 at 08:26:01PM -0500:
> Is there a way to store the time and date that a record was added within
> MySQL? I want to show the time and date on some of my records and can't seem
> to figure out an easy way to do it. Thanks!

Either add a timestamp column to your table, and in your insert statements
OMIT this column so that it will be set to the current time.  But in your
update statements, you've got to take care of this column, so add something
like "UPDATE TBL SET TimestampCol = TimestampCol".  This will set the value
of the timestamp column to the old value.  Not doing this will set it to the
then current time.

Or add a datetime column and set it to the current time when INSERT'ing with
"INSERT INTO TBL SET DatetimeCol = NOW()"

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:       http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                Uptime: 23 hours 38 minutes

---------------------------------------------------------------------
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