简体   繁体   English

php时间函数

[英]php time function

what is wrong with this sql query? 这个SQL查询有什么问题? he is crying on NOW() :( 他现在在哭NOW() :(

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

Are you using MySQL or Microsoft SQL Server? 您使用的是MySQL还是Microsoft SQL Server? NOW() doesn't work in SQL Server; NOW()在SQL Server中不起作用; need to use GETDATE() instead. 需要使用GETDATE()代替。

也许使用当前的时间戳会更好的主意,我不知道,只需在mysql中键入时间戳你会在谷歌上找到它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM