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

Or make a TIMESTAMP column and omit it from the field list of your INSERT.

More info can be found at http://www.mysql.com/doc/D/A/DATETIME.html

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