View Full Version : New! Please Help!

11-24-2010, 10:55 AM
I am doing my own site now. :)
I am kind of new and I need help. I am doing like a game site in PHP. I would like all the animal to age every week. I mean like if you adopted a 3 year old horse and I want it to be 4 years old at the end of the week. And then 5 and 6...
Can anyone tell me how do I do that?

11-24-2010, 11:02 AM
Assuming you have access to a database of some description for this project, you could store the "birth date" of each animal in the database and then when someone comes on to play the game, the system first updates all of the ages of each animal before you can play.

Essentially this would just mean the system working out the number of days between the current date and the birth dates and then dividing this by 7 to find the number of weeks and then simply updating the age in the database.

Hope this gives you a starting point!