ted_chou12 Posted January 2, 2007 Share Posted January 2, 2007 What I want this column of mysql table to store is users last login time, is it the right thing to choose? Quote Link to comment https://forums.phpfreaks.com/topic/32580-solved-whats-on-update-current_timestamp-current_timestamp/ Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 The column type should be timestamp yes. Then when you update the table you use the CURRENT_TIMESTAMP constant or you can just use PHPs time function which will place a unix timstamp (number of secounds passed since 1 Jan 1970). Then you convert the timestamp into a formatted date by passing the timestamp to the date function as the second parameter. Quote Link to comment https://forums.phpfreaks.com/topic/32580-solved-whats-on-update-current_timestamp-current_timestamp/#findComment-151500 Share on other sites More sharing options...
ted_chou12 Posted January 2, 2007 Author Share Posted January 2, 2007 thanks Quote Link to comment https://forums.phpfreaks.com/topic/32580-solved-whats-on-update-current_timestamp-current_timestamp/#findComment-151502 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.