adding the date to a database
| From: | Brad Wright | Date: | Wed, 18 Jul 2001 19:12:02 +0000 |
| Subject: | adding the date to a database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-58517@lists.php.net to get a copy of this message | ||
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);
This does not work (but returns no errors) ie, nothing inserted into the
database.
Thanks,
Brad