I am trying to export data from a mysql database to an excel spreadsheet using php. The script works fine in Excel 2003, but in 2007 I get the folowing error:
The file your are trying to open 'filename.xls', is in a different format that specified by the file extension. Verify that the file is not corrupted and is from a trusted srouce before opening the file. Do you want to open the file now?
You can still click "yes" and open the file. Anyone know a way to solve this annoyance?
Export to excel in php
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Export to excel in php
Well to start with, how are you generating your Excel spreadsheet?r4r4 wrote:I am trying to export data from a mysql database to an excel spreadsheet using php. The script works fine in Excel 2003, but in 2007
Anyone know a way to solve this annoyance?
Re: Export to excel in php
CSV is the simplest way, but PHPExcel is also a great tool for when you need a bit more flexibility as to how the sheet turns out. There are one or two other php Excel libraries out there, if you google them.
Re: Export to excel in php
Split from another topic. Note to original poster: please ask new questions as a new post, don't "tail-gate" on another topic.