Php time function

what happened to this sql query? he cries at NOW(): (

("INSERT INTO " . PREFIX . "messages (from, to, title, message, date) 
VALUES (" . $from . ", " . $to . ", " . $subject . ", " . $message . ", NOW())");
+3
source share
2 answers

Are you using MySQL or Microsoft SQL Server? NOW () does not work in SQL Server; instead, use GETDATE ().

+3
source

Maybe using the current timestamp would be a better idea, I don't know, just enter timestamp in mysql, you will find it in google

-2
source

Source: https://habr.com/ru/post/1734429/


All Articles