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.
PHP Scheduling Update ?
Moderator: General Moderators
Re: PHP Scheduling Update ?
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 ?
Can you give me a hand ?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: PHP Scheduling Update ?
If you want to execute a script on timed intervals, on Linux there is Cron Jobs, and on Windows there is Task Scheduler.
Re: PHP Scheduling Update ?
I thought of that too.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.
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 ?! ^^
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: PHP Scheduling Update ?
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.
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.