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 |
|---|
| • Doubt | Sreevatsava Varada | 3 May |
| • Re: Doubt | Eric Fitzgerald | 3 May |
| • Re: Doubt | Paul DuBois | 4 May |
| • RE: Doubt | Chris Bolt | 4 May |