I have a column which contains a timestamp in my MySQL database. No matter how many times I update my records, my timestamps are not updated. Is there anything I should do to make it auto update?
Searching other questions here in Stackoverflow, most of them say the opposite, it's really very confusing! For example, this one, Should I use field 'datetime' or 'timestamp'? (Look at the top rated answer)
Thank you
Here is my table structure
+----------------+-------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+-------------------+----------------+
| Num | int(11) | NO | PRI | NULL | auto_increment |
| mem_name | varchar(50) | NO | | NULL | |
| mem_id | int(11) | NO | | NULL | |
| car_number | varchar(11) | NO | | NULL | |
| firstcall_time | timestamp | NO | | CURRENT_TIMESTAMP | |
| tow_time | datetime | NO | | NULL | |
+----------------+-------------+------+-----+-------------------+----------------+
6 rows in set (0.00 sec)
One Record:
+-----+----------+--------+------------+---------------------+---------------------+
| Num | mem_name | mem_id | car_number | firstcall_time | tow_time |
+-----+----------+--------+------------+---------------------+---------------------+
| 1 | Jakey | 54564 | SHA34345 | 2013-02-19 16:14:12 | 2013-02-19 16:32:45 |
+-----+----------+--------+------------+---------------------+---------------------+
1 row in set (0.00 sec)
After Updating:
+-----+----------+--------+------------+---------------------+---------------------+
| Num | mem_name | mem_id | car_number | firstcall_time | tow_time |
+-----+----------+--------+------------+---------------------+---------------------+
| 1 | Tommy | 54564 | SHA34345 | 2013-02-19 16:14:12 | 2013-02-19 16:32:45 |
+-----+----------+--------+------------+---------------------+---------------------+
1 row in set (0.00 sec)