Reputation: 1102
Why is my NOW() function in mySQL statement, always setting the date to 01-01-1970 01:00:00 instead of the current date and time?
This is my statement.
("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)");
Upvotes: 0
Views: 95
Reputation: 2378
The field transactiontime must be DATETIME and you will can use NOW() '2013-06-11 12:45:34' or CURDATE() '2013-06-11' or CURTIME() '12:45:34'.
Good luck.
Upvotes: 1