Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-09-2005, 11:53 PM   PM User | #1
rayd
New to the CF scene

 
Join Date: Feb 2005
Location: Colorado
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
rayd is an unknown quantity at this point
Export mySQL to Excel in scheduled email

I have a PHP script that queries mySQL DB and coverts result into tab delimited, then the user can open http://xyz.com/report.php and will get prompted to open/save the Excel.

My user now needs me to generated this report on a scheduled interval ( e.g., every 10 minutes) and then have it emailed to them. This is on a hosted server.

I tried to use crontab:
1. I first tried wget: wget -O test.xls http://www.xyz.com/report.php
but got some kind of permission denied error, I searched the web and this might have something to do with not been able to write to somewhere...(linux thing)

2. I then tried lynx -dump http://www.xyz.com/report.php this worked! but I just get an email with tab delimited data in plain format, not Excel.

3. I have thought about using Spreadsheet::WriteExcel in perl or the PEAR version, but that will take a lot more work and I might have to ask the hosting company to install stuff again...

Do you have any comments on what I am trying to do? Am I doing something wrong? Am I missing something simpler?

I had to ask the host to enable crontab and wget already, on one hand I don't want to keep asking them for stuff and can't get it to work, on the other hand this looks like a pretty lame installation to began with...It seems to be a very basic/limited hosting plan)

Thank you.
rayd is offline   Reply With Quote
Old 02-11-2005, 04:24 PM   PM User | #2
rayd
New to the CF scene

 
Join Date: Feb 2005
Location: Colorado
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
rayd is an unknown quantity at this point
Cool

I figured it out.

1. Schedule crontab to run this regularly
2. Pulled the data from DB, dumped it into an Excel using PEAR library Spreadsheet_Excel_Writer.
3. Emailed it to client using phpmail

PM me if you like to know more.
rayd is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:14 AM.


Advertisement
Log in to turn off these ads.