stefan
stefan

Reputation: 31

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())");

Upvotes: 3

Views: 100

Answers (2)

Scott Vander Molen
Scott Vander Molen

Reputation: 6439

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

Upvotes: 3

ant
ant

Reputation: 22948

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

Upvotes: -2

Related Questions