PDA

View Full Version : PHP to Excel from MySQL database


cocoonfx
03-04-2010, 12:35 AM
Hello chaps


I have a ticketing system which has no standardised reporting. Its driven by a mysql database which I can query no problem.

However I am wanting to send the data to a csv or an excel document as a report.

Does anyone know any decent basic step by step tutorials on how to create the PHP to excel.

I have tried the code from this site but I can not get excel to format properly.

http://www.appservnetwork.com/modules.php?name=News&file=article&sid=8

Any assistance would be appreciated.

Regards
Cocoonfx

edbr
03-04-2010, 02:13 AM
http://www.ineedtutorials.com/code/php/export-mysql-data-to-csv-php-tutorial

davidj
03-04-2010, 10:32 AM
if you output and save as a CSV file then this will open / import into excel easily

Hint: fopen, fwrite and a couple of foreach loops will sort you out here

This is the easiest method else you will be playing with mime types and everyone hates a mime!!

with their white gloves and heavy suitcase bollocks!!

cocoonfx
03-04-2010, 02:03 PM
Cheers chaps, I will come back with my findings....:mrgreen: