PHP Scheduling Update ?

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
Horus
Forum Newbie
Posts: 3
Joined: Sat Oct 10, 2009 4:41 pm

PHP Scheduling Update ?

Post by Horus »

Dear members of the PHP Dev Network,
I've been thinking on this problem for quite some time now and I can't seem to find a decent solution for it (maybe due to my very limited knowledge). Here's the deal:
- I made a few Scripts that retrieve information from a certain MySQL Database on a host (Web Host != Host) and then prints an html. The problem is: The Host can't be constantly bombarded with SQL queries everytime someone enters the site (Hence seeing the script, not only overloading the host with queries, as it would consume a lot of bandwith from the web host and make it slower since it will have to constantly applying the code). So I was wondering if anyone knows a way to e.g. load the script every 30 mins, the script writes the data into a file which is then read by the host (there has to be an output file I guess).

Looking forward for your answer,

Thank you for your time and patience,

Horus.
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: PHP Scheduling Update ?

Post by JNettles »

Horus
Forum Newbie
Posts: 3
Joined: Sat Oct 10, 2009 4:41 pm

Re: PHP Scheduling Update ?

Post by Horus »

Well don't take me wrong, but if you wanna talk about java I can maintain a decent conversation. But in terms of PHP I am not your man for sure lool. Basically I have absolutely no idea on how to use the cache.
Can you give me a hand ?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: PHP Scheduling Update ?

Post by John Cartwright »

If you want to execute a script on timed intervals, on Linux there is Cron Jobs, and on Windows there is Task Scheduler.
Horus
Forum Newbie
Posts: 3
Joined: Sat Oct 10, 2009 4:41 pm

Re: PHP Scheduling Update ?

Post by Horus »

John Cartwright wrote:If you want to execute a script on timed intervals, on Linux there is Cron Jobs, and on Windows there is Task Scheduler.
I thought of that too.
But I need to make a cronjob that executes a PHP file that writes a new .html file.
how the hell do I make php do that ?! ^^
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: PHP Scheduling Update ?

Post by John Cartwright »

How do you write a file in PHP? What have you tried? There are probably thousands of tutorials on the subject, including the very usefull manual.

A quick google search: PHP Write File

Relevant PHP functions, fopen() + fwrite() + fclose(), or preferably file_get_contents() and file_put_contents()

Give it a shot, and let us know what specifically you are having issues with.
Post Reply