markvaughn2006 Posted September 19, 2009 Share Posted September 19, 2009 I have a field that stores the date a character in this game was created and a days_old field, how would I go about adding 1 to that field each new day? Thanks a bunch!! Link to comment https://forums.phpfreaks.com/topic/174838-auto-increment-a-days_old-field/ Share on other sites More sharing options...
BioBob Posted September 20, 2009 Share Posted September 20, 2009 UPDATE field SET days_old = days_old + 1, date = TIMESTAMP() WHERE date < TIMESTAMP - (60*60*24) or something like that. Depends on how you have your time set up. Epoch time or with a formatted date... Link to comment https://forums.phpfreaks.com/topic/174838-auto-increment-a-days_old-field/#findComment-921897 Share on other sites More sharing options...
fenway Posted September 21, 2009 Share Posted September 21, 2009 OR SET days_old = days_old + INTERVAL 1 DAY. Link to comment https://forums.phpfreaks.com/topic/174838-auto-increment-a-days_old-field/#findComment-922581 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.