|
Cron job and mysql data
After being introduced to cron jobs a couple of days ago, I think its the coolest thing.I'm wondering how it may work with mysql data.
Every night, I will input some stock data into a mysql database.
In my webpage, I have a table that fetches the information from my database and displays it in a table format(I use PHP for this).
The problem is, it seems that fetching the data from the database everytime I refresh the webpage is kinda slow.
I have idea as follows :
1)I would have a new page that includes ONLY the php code that fetches the data and displays it in a table format.
2)Then everynight I would use a cron job with the following code :
#!/usr/bin/perl
use LWP::Simple;
mirror ('http://www.mydomain.com/mystock data.php3','tabledata.html');
This html would capture the php output. The reason for the new html page is so that it loads faster because it doesn't have to call up the mysql database.
The question is......How do I grab this mirrored html page and insert it into a portion of another existing webpage?
Any thoughts on this process?
I tried the new html page page and the table loads a lot faster, but I don't know how to insert this table to another page.
Or is there an even easier way?
thanx
|