Php Scheduling

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
kosaks
Forum Newbie
Posts: 10
Joined: Thu Aug 18, 2011 10:21 am

Php Scheduling

Post by kosaks »

Hello to everyone

Does anyone knows how to schedule php script? I have a script that saves the scheduled task on MYSQL database. What i want is that when the scheduled task reach its due date, the php script will initiate automatically without any user interaction.

I've tried using Windows Scheduler but it will not solve my problem because windows scheduler only runs when it reaches its scheduled time. Only then the script will initiate.

Please help me guys. I will really appreciate all the help i cant get.

thanks in advance
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Php Scheduling

Post by AbraCadaver »

You have a date and a script name (let's call it script.php) in MySQL. Write another script (let's call it check_date.php) that queries the database for the current date and executes the associated script (script.php). Now set up a scheduled task that runs check_date.php every day at midnight. You could also set this up to run every five minutes if you want.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
kosaks
Forum Newbie
Posts: 10
Joined: Thu Aug 18, 2011 10:21 am

Re: Php Scheduling

Post by kosaks »

Hello sir

thanks for the reply. i was hoping if i can call the php script everytime the schedule will reach it's due date. anyways your reply was also helpful.

thank you so much.
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: Php Scheduling

Post by Doug G »

You may be able to fire off the php script from a mysql function or procedure called by the existing mysql procedures. Just a guess.
kosaks
Forum Newbie
Posts: 10
Joined: Thu Aug 18, 2011 10:21 am

Re: Php Scheduling

Post by kosaks »

Hello

thanks for the replies. My problem is fixed with the help of windows scheduler
Post Reply