At 08:59 AM 6/13/2002, you wrote:
>Hello,
>      I am sure this is an easy question but I am not thinking clearly for 
> some
>reason.  :^)
>
>      If you set a column to auto_Increment.  You do not have to put the
>auto_increment # in the insert statement to get it to be inserted.  Mysql
>does this automatically.
>
>      Is there a way to have the timestamp automatically inserted when an
>insert statement is run?  The timestamp of the insert statement.
>
>thanks for the help,
>chad
>
>
>--
>Chad Kellerman

Chad,
         The first TimeStamp column gets updated whenever the record is 
inserted *or* modified so this wont help you if you only want the create 
date and not the modify date. Additional timestamp columns are not 
automatically updated.  This means you need to insert a value explicitly 
for the create date as in:

insert into mytable values(....,create_date) values(...., now());

Your create_date column can be a timestamp or datetime column. I prefer 
datetime because they are formatted properly when doing a select on the table.

Mike


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