On 18-Jul-2001 Brad Wright wrote:
> 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.
> 

did you test $result ?

It's usually helpful to check the manual when you're not sure of the syntax
for MySQL you can use NOW() , CURDATE(), or CURRENT_DATE.


-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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

Reply via email to