为什么我的NOW()函数不起作用

时间:2013-06-11 09:04:52

标签: mysql

为什么我的NOW()函数在mySQL语句中,总是将日期设置为01-01-1970 01:00:00而不是当前日期和时间?

这是我的陈述。

("INSERT INTO transactions 
(phoneid,ip, created, cardid, pricebefordiscount, 
priceafterdiscount, discount, transactiontime, 
raw, restaurant_id, confirmed, processed, before_after_discount, 
fix, error, waiter, referer)


Values
(0,0,0,'$memberparamter','$discountPrice','$new_subtotalparamter',null,NOW(),null,'$rest_id',0,0,0,0,0,0,0)");

1 个答案:

答案 0 :(得分:1)

字段事务时间必须为DATETIME,您可以使用NOW()'2013-06-11 12:45:34'或CURDATE()'2013-06-11'或CURTIME()'12:45:34 ”。

祝你好运。

相关问题