I want to save the time when user get registered. This is my table data
nic name age time
190 ali 27 2012-04-13 17:31:19
217 bilal 32 2012-04-15 02:00:40
382 hamza 21 2012-04-17 20:59:29
I manually created time attribute in MYSQL
Column : time
Type TIMESTAMP
Default : CURRENT_TIMESTAMP
attributes: on update CURRENT_TIME
Now I want to permanent save this time.. When the registered user update his profile the time automatically updated.
Is there any way to not change the time on update, I just want to save permanently time when user get registered and not to change it on any kind of update
Don’t specify
ON UPDATE CURRENT_TIMESTAMP. Instead, rely only on theDEFAULT CURRENT_TIMESTAMPand omit the column from yourINSERTstatement.By including the
ON UPDATEspecification, you are forcing the timestamp column to change whenever the row changes. You don’t need that.