Re: Inserting a date in to DATE field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 23 Apr 2004 01:32:36 +0000
"Pambos Nicolaou" <pambos_15@xxxxxxxxxxx> wrote:

> Hi everyone,
> 
> Is there any MySQL command which inserts the date into a DATE field of
> a table automatically. For example the user inserts into the table
> several values (name, age, etc) and the date is inserted
> automatically.
> 

Pambos,

Short answer not really.

You can get around it by using a timestamp data type. in you insert query, don't worry about setting the timestamp to a value and mysql will set it to the time and date as the time that the record was inserted.

The other way is to alter your insert queries to
insert into table set .... date_field=now()

George Patterson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux