Page 1 of 1

Incrementing via time?

Posted: Tue Aug 21, 2007 7:38 am
by SirChick
What feature in php can i use to increment a number field in my user table by say like 5 every 10 minutes but once it reaches the same as another field such as "max" itll stop incrementing?

I've not done code which runs upon time, only upon user actions... is there such a feature ?

Posted: Tue Aug 21, 2007 7:54 am
by VladSun
Search for crontab. But I can't tell you whteher it is available on your server or not - it depends on your hosting provider.

Posted: Tue Aug 21, 2007 8:01 am
by SirChick
well im using local host xampp package which is apache at the moment :/

can't i make crons work off my computer time temporarily until i buy a real server?

Posted: Tue Aug 21, 2007 8:04 am
by VladSun
XAMPP for Windows or for Linux?

Posted: Tue Aug 21, 2007 8:15 am
by SirChick
windows

Posted: Tue Aug 21, 2007 8:20 am
by VladSun
http://drupal.org/node/31506

You need to call php like this:

Code: Select all

php -q -f file_to run.php
If you have problems try using full path to php and file_to_run.php.

Posted: Tue Aug 21, 2007 8:35 am
by SirChick
hmm that link guide seems to be about an older version im using vista which is different there is no

# Double-click Add Scheduled Task
# The Scheduled Task Wizard will appear. Click Next.

And creating a task theres no option of picking a browser

Posted: Tue Aug 21, 2007 8:40 am
by feyd
You wouldn't use a browser. It's a command line call.

icron may of interest too. I don't know if it's compatible with Vista however.