3

Let's go ahead and get this out of the way - i realize I can generate tables with php and mysql and output in 'almost' any format I need but in this scenario, the excel spreadsheet is formatted in some strange ways (layout, color, etc) and the client won't budge. I have to use the exact excel spreadsheet.

I am trying to pull data from a mysql database with php calculations behind it and populate various cells within an Excel file. Is it possible to do this?

Thank you ahead of time

12
  • What version of Excel? That is going to be important Commented Jan 19, 2011 at 22:15
  • Start by looking at PHP libraries capable of writing Excel files... you have googled for PHP and Excel haven't you? Commented Jan 19, 2011 at 22:16
  • load data outfile to csv, and open the csv in Excel... Commented Jan 19, 2011 at 22:17
  • I am not looking to write an excel file. As I mention, I want to open an existing file, add data to it, and save it all with PHP Commented Jan 19, 2011 at 22:18
  • 1
    @Mark - you are correct, if I googled every possible search term on the planet involving xls, excel, microsoft, php, mysql I might have found the answer in three seconds. My question is posted here to get clarification from a network of trusted individuals who might provide insight into what is "good", what works, and what is crap. You ask me for a recommendation on what is good to eat in New York and I tell you to Google it for the answer is absurd. Note: "populate excel spreadsheet php" and "write to existing .xls php" do not talk about the software at all. Commented Jan 19, 2011 at 22:26

1 Answer 1

5

You can try PHPExcel ( http://phpexcel.codeplex.com/). I think this is what you are looking for.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for the link. I came across this link before (and i should have added to my intial question) but we run Excel 2003 so the XML from 2007 does not apply (I think).
MS Excel 2003 reads/writes BIFF8 xls files as its default format... This is the Exce5 Reader/Writer in PHPExcel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.