Re: Re: How can I add records to database every 60 minutes???
| From: | erythros | Date: | Wed, 30 Jul 2003 16:01:36 +0000 |
| Subject: | Re: Re: How can I add records to database every 60 minutes??? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157536@lists.php.net to get a copy of this message | ||
yea... if no one hits the website for hours then only a few updates will
occur.
you could however write a very small javascript to call on a php script
every hour.
"Skate" <root@fatcuban.com> wrote in message
news:034a01bffa3b$480e62a0$1400000a@fatcuban...
>
> > 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.
>
>
>