I use the query:
UPDATE `times` SET `date` = 2012-04-04 WHERE `id` = 1 AND `id2` = 2;
It shows an update successful, but the time shows 000-00-00.
any clue?
When i use phpMyadmin the filed will show what data I want to put in. After putting in the same information, the data changes. But how come sql doesn’t?
Am I using the wrong data format for date?
You need to enclose date with single quotes.
Your previous statement was probably trying to update
dateto a numeric value of2004(2012minus4minus4).