Hi, I'm writing an online game and I need to know the last time the user was playing so the game can allocate extra turns/health. Basically I want it to work as below:
1) At end of each page there is a statement setting a field in that user's record in my user table to the current date and time, that field is defined as a datetime field at the mo.
2) When a page loads, it checks the stuff saved above and if it is a new day (3 game days to one normal day = 8 hours each), then they get allocated extra turns to use and some health is regenerated.
Basically, I have no experience whatsoever using dates and times in php, so I need help. I've probably missed out loads of stuff you need to know to help me, so anything you need, just ask.
1) At end of each page there is a statement setting a field in that user's record in my user table to the current date and time, that field is defined as a datetime field at the mo.
2) When a page loads, it checks the stuff saved above and if it is a new day (3 game days to one normal day = 8 hours each), then they get allocated extra turns to use and some health is regenerated.
Basically, I have no experience whatsoever using dates and times in php, so I need help. I've probably missed out loads of stuff you need to know to help me, so anything you need, just ask.