List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 2 2000 10:50pm
Subject:Re: ### insert default date ###
View as plain text  
At 10:01 PM +0200 10-02-2000, Marcel Nicolai wrote:
>Hello mysql,
>
>i i have problem with datetime type.
>
>   I need to create a field : datetime and by default set this field
>to current
>   time.
>
>   mySQL have some functions like now(), var like $CURRENT_DATE and
>when i
>   write
>   1. idate datetime default now() - error
>   2. idate datetime default 'now()' - when insert mySQL set this
>      field to '0000-00-00 00:00:00'
>   3. idate datetime default '$CURRENT_DATE' - when insert mySQL set
>this
>      field to '0000-00-00 00:00:00'
>
>   (in Interbase BD Server: idate date default 'now')

You have to set the date to NOW() manually when you create new rows.
Default values must be constants, not functions.

-- 
Paul DuBois, paul@stripped
Thread
### insert default date ###Marcel Nicolai2 Oct
  • Re: ### insert default date ###Paul DuBois3 Oct
  • Re: ### insert default date ###Harald Fuchs3 Oct