MySQL Forums
Forum List  »  Newbie

Timestamp fields
Posted by: Sebastian Jurk
Date: October 18, 2012 12:58PM


i have a table where i inserted a timestamp because i store there unix-timestamps manually. The data i store in there is the time a trade happened.

Now i thought it would be good and interesting to know when a recordset was created and when a recordset was updated. Mysql seems to have such possibility built in so i created 2 columns as timestamp and gave them the standard current timestamp and the second on update current timestamp.

But it didnt work because only one field is allowed.

I then found that the first timestamp, which i always store myself has the standard and on update setting. I tried to delete them and phpmyadmin only tells me that my table was successfully changed and... both settings are still in there.

Is there the possibility to have on unix-timestamp-field (which shows me the correct time in phpmyadmin so i dont need to calculate myself) where i only store the data in myself, one timestampfield that only holds the time when the recordset was created and one timestampfield that only holds the time when the recordset was last updated. It would be best when the last both work independently from me so that i dont have to think about them or have to code them manually.


Options: ReplyQuote

Written By
Timestamp fields
October 18, 2012 12:58PM
October 20, 2012 10:18AM
October 20, 2012 12:34PM
October 22, 2012 09:46AM
October 20, 2012 09:42PM
October 21, 2012 06:41AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.