...

View Full Version : New! Please Help!



Carolyne
11-24-2010, 09: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?

rfennah91
11-24-2010, 10: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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum