Help exporting mysql data to spreadsheet excel

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dynastym3
Forum Newbie
Posts: 13
Joined: Sun Apr 05, 2009 2:12 am

Help exporting mysql data to spreadsheet excel

Post by dynastym3 »

Does anyone know how to export mysql data into a excel spread sheet or know of a tutorial???
User avatar
deejay
Forum Contributor
Posts: 201
Joined: Wed Jan 22, 2003 3:33 am
Location: Cornwall

Re: Help exporting mysql data to spreadsheet excel

Post by deejay »

you can do it with fputcsv - see here http://uk2.php.net/manual/en/function.fputcsv.php
dynastym3
Forum Newbie
Posts: 13
Joined: Sun Apr 05, 2009 2:12 am

Re: Help exporting mysql data to spreadsheet excel

Post by dynastym3 »

the site is not working is there another one you know of?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Help exporting mysql data to spreadsheet excel

Post by Christopher »

Probably the easiest is to just generate CSV data and give it the Excel MIME type using header(). The browser will use Excel to open it and it will usually import automatically. There are some Excel libraries for PHP that generate the actual Excel file format. Search...
(#10850)
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Help exporting mysql data to spreadsheet excel

Post by Mark Baker »

If you want a real Excel file rather than just a CSV, then try PHPExcel
Post Reply