project is written on php.
There is timestamp field in mysql it updates automatically. In one case I don`t need update this field. Can I gibe instruction not to update this field in this queries without getting timestamp value.
views:
33answers:
2
+2
A:
You should change it to DEFAULT CURRENT_TIMESTAMP
otherwise it will auto-update. From the manual:
In a CREATE TABLE statement, the first TIMESTAMP column can be declared in any of the following ways:
With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.
With neither DEFAULT nor ON UPDATE clauses, it is the same as DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP.
With a DEFAULT CURRENT_TIMESTAMP clause and no ON UPDATE clause, the column has the current timestamp for its default value but is not automatically updated.
Sarfraz
2010-06-13 14:44:17
Thank you. I was using old PMA version
GOsha
2010-06-13 15:47:44
+1
A:
Edit the column in phpMyAdmin and unselect the option for "on update current timestamp."
Aaron Harun
2010-06-13 14:44:35