Re: Re: How can I add records to database every 60 minutes???
| From: | skate | Date: | Sun, 30 Jul 2000 15:31:19 +0000 |
| Subject: | Re: Re: How can I add records to database every 60 minutes??? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157531@lists.php.net to get a copy of this message | ||
> i take it scripts are being called over and over right? if so then add
a
> time function to one of those scripts. when gameplay starts load the time
to
> mysql (or a file) and then everytime the script is run check the time to
see
> if the time has exceeded 60 minuets, if it has run you php script to load
> the data to mysql.
the trouble with this is what if no-one hits the page for several hours?
will it run 3-4 updates at once, or just the one?
i'm guessing what your actually after is cron. you'd be running it on a *nix
box for this, but you get cron to run the script every hour.
i'm guessing your making some kind of ticker? similar to that in
www.planetarion.com ? it's a fairly easy thing to do, and if you do a search
for planetarion clones, you'll find exactly what your looking for.
don't have a script that runs permanently tho, please. huge waste of
resources, and you've also got the problems of timeouts, and how to restart
a script if it crashes.