Faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

41 of 63 people (65%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I generate a html file each day with content from MySQL, fully automated?
Anyone have any ideas for generating a daily statistics page for database records?

Jun 13th, 2000 15:52
Alok Sinha, Luc Demarteau, unknown unknown, Jean-Marc Molina,


You will need to create a php script that reads the data from mysql 
database and reports the output in a web page. Then you would need to 
run this script from the cron job. To run this script from cron job, you 
could either launch a program like lynx to launch this or if you have 
the cgi version of php installed, execute the php script followed by the 
 php script name.
Steps :
write a php script (script.php) to
   connect to db
   login to db
   query contents 
   write output to a local file, call it something.html
in the cron, make entry lynx http://yourservername.com/script.php
                  or    php /path/to/script.php
That shud do your job.