Reporting tool for stats pulled from MySQL db
| From: | Lisi | Date: | Tue, 25 Feb 2003 09:40:45 +0000 |
| Subject: | Reporting tool for stats pulled from MySQL db | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25901@lists.php.net to get a copy of this message | ||
I have a stats tracking program and a page that displays stats for various dates/items depending on what options the user selects. I need to add some kind of external reporting tool, i.e. they'd like to download the information, preferably in Excel.
I tried forcing Excel to open the data instead of the browser by sending headers:
Header("Content-Type: application/vnd.ms-excel");
Header("Content-Disposition: attachment; filename='stats.xls'");
When I sent just the first one, all I got was a blank broswer page with a picture (application?) icon in the top left hand corner. Then I added the second header, which I found in a previous post in the archives, and that forced a download but of the page itself (stats_print.php).
1) What am I doing wrong?
2) Every posting I found in the archives said this is the easiest way. Is there another, harder but might work for me, way anyone would suggest of doing this?
Thanks in advance,
-Lisi