Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Location
    -
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation New! Please Help!

    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?

  • #2
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post
    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!

  • Users who have thanked rfennah91 for this post:

    Carolyne (11-24-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •