List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 4 2001 1:59am
Subject:Re: Doubt
View as plain text  
At 8:33 AM +0530 5/3/01, Sreevatsava Varada wrote:
>Hi,
>
>    I've recently moved from MS-SQL Server 7.0 to mySQL. In MSSQL I 
>used to give the default value 'GetDate()' for a field in the 
>database with the datetime datatype. In mySQL I tried using Now(). 
>But when I insert a new row the datetime field is taking 0000:00:00 
>00:00:00 value. Please let me know what should I give as the default 
>value for 'record_date' field (of datetime datatype) so that it 
>takes the value returned by Now() function when a new row is 
>inserted using php script.

Default values must be constants in MySQL.  When you create a new record,
initialize your date field to NOW() explicitly.

>
>Thanks.


-- 
Paul DuBois, paul@stripped
Thread
DoubtSreevatsava Varada3 May
  • Re: DoubtEric Fitzgerald3 May
  • Re: DoubtPaul DuBois4 May
    • RE: DoubtChris Bolt4 May