The easiest way to do this would be to have cron run a perl script every hour. You could then have the perl script do the SQL query and handle the mailing of output. If you do a search on the forum you will find a few examples showing how to connect to a MySQL database with perl.
|