Brad Wright pressed the little lettered thingies in this order...
> Hi,
> I have a database with a 'date' field. What is the syntax for using the
> (mysql) function 'getdate()', to insert the date into the DB table.
> the syntax I'm currently using is:
> $query = "Insert INTO visits (visName, date)
> values ('$name', getdate()) " ;
> $result = mysql_query($query, $db);
>
If you're using MySQL 3.23 (or newer) and the field is one of the date,
time or datetime types, use NOW()
For example:
$query = "Insert INTO visits (visName, date)
values ('$name', NOW()) " ;
This returns a "-MM-DD HH:MM:SS" string that MySQL will
automatically convert to any of the date/time field types.
Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the
dawn of Internet time (1995)
For a good time,
http://www.AppIdeas.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]