tags:

views:

70

answers:

2
+2  Q: 

php time function

what is wrong with this sql query? he is crying on NOW() :(

("INSERT INTO " . PREFIX . "messages (from, to, title, message, date) 
VALUES (" . $from . ", " . $to . ", " . $subject . ", " . $message . ", NOW())");
+2  A: 

Are you using MySQL or Microsoft SQL Server? NOW() doesn't work in SQL Server; need to use GETDATE() instead.

Scott
`GETDATE()` is SQL Server specific - this question is for **MySQL**. `CURRENT_TIMESTAMP` is ANSI standard however, supported on both.
OMG Ponies
@Scott: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now ?
Adam Kiss
Woops, I've been trapped in the SQL Server world for too long.
Scott
FYI: the original question did not specify SQL or MySQL
David Radcliffe
A: 

Maybe using current time stamp would be better idea, I don't know it, just type timestamp in mysql you'll find it on google

c0mrade
why the down votes ?
c0mrade