RE: [PHP] game in php

From: Date: Sun, 07 Sep 2003 22:21:25 +0000
Subject: RE: [PHP] game in php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161940@lists.php.net to get a copy of this message
Another way you can do it if you don't have that much access to the machine is to record the last time it was updated and when someone loads the page, you take the amount of time between the last incriment and now(). You then find out how many sets of 10 minutes have passed and incriment it that many times (if it's less than 10 minutes, you'll be incrimenting zero times). The only problem with this is that if 100 people load the script in a 10 minute period, only one will be updating the database - the other 99 are wasted traffic on the DB. But if you have no other options... -----Original Message----- From: Jon Haworth [mailto:jon@laughing-buddha.net] Sent: Sunday, September 07, 2003 6:10 PM To: php-general@lists.php.net Subject: Re: [PHP] game in php Hi, > I have this database with this fields; id and > number_attacks. And every 10 minutes > number_attack to be increased by 1. You'll need to set up some sort of scheduled task (if you're on unix, your best bet is probably cron) - this task should call a script that connects to your database and updates the field. If you like, you can write the script in PHP and use something like lynx or wget to access it. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#161940) next »