Incrementing via time?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Incrementing via time?

Post 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 ?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Post 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?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

XAMPP for Windows or for Linux?
There are 10 types of people in this world, those who understand binary and those who don't
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Post by SirChick »

windows
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
SirChick
Forum Contributor
Posts: 125
Joined: Tue Jul 31, 2007 11:55 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply