0

I want to update a column in a table, as the following :

ALTER TABLE annonce MODIFY COLUMN date_crea DEFAULT CURRENT_TIMESTAMP;

but I got this error :

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CURRENT_TIMESTAMP' at line 1

How can I solve this ?

Renaud is Not Bill Gates
  • 1,684
  • 34
  • 105
  • 191
  • Perhaps show your structure of your table.. my guess is there date_crea or something like that is spelled wrong. – Gooey Dec 15 '13 at 19:13
  • You're missing the datatype. `ALTER TABLE annonce MODIFY COLUMN date_crea TIMESTAMP DEFAULT CURRENT_TIMESTAMP;` or `datetime` [dependant on version](http://stackoverflow.com/a/168832/73226) – Martin Smith Dec 15 '13 at 19:19

0 Answers0