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!! Quote 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... Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.