【发布时间】:2013-01-25 10:26:33
【问题描述】:
如何在 MySQL 中插入 CURDATE() 和 CURTIME()?
我将它们分别插入到数据库表中的日期和时间字段中。
$query = "INSERT INTO `ordisp` (date, time, operator, status, completed, name, email) VALUES (CURDATE(), CURTIME(), '".$operator."', '".$status."', '".$complete."', '".$name."', '".$email."')";
为什么这不起作用?
【问题讨论】:
-
什么不起作用?你有什么错误吗?可能是因为你的尾随
,?或者可能是因为使用了保留字? -
请填写您在使用上述代码时遇到的错误