hey all
then i want write mysql information in excel
for exemple
we have table
name lastname
jonh1 jonh1
jonh2 jonh2
jonh3 jonh3
and etc
i want write in php help all name's in excel document
help me
write mysql information in excel
Page 1 of 12 Replies - 763 Views - Last Post: 18 January 2008 - 11:44 PM
Replies To: write mysql information in excel
#2
Re: write mysql information in excel
Posted 18 January 2008 - 02:44 PM
And of course I bet you want to be exportable so that someone can save the excel document it generates huh? If that is the case, you just need to do three things...
1) You need to set the "Content-Type" for the page to "application/vnd.ms-excel"
2) You need to add the header "Content-Disposition: inline; filename=nameoffilegoeshere.xls" (Do remember the rule about headers, send no data before you use header() or else you will get an error)
3) Write the content of the mysql records as you would an html table. The HTML and table cells will go straight into excel forming a table.
The rest should be cake.
Hope this has helped you. Enjoy!
"At DIC we be content exporting to excel code ninjas! Excel has nothing on us."
1) You need to set the "Content-Type" for the page to "application/vnd.ms-excel"
2) You need to add the header "Content-Disposition: inline; filename=nameoffilegoeshere.xls" (Do remember the rule about headers, send no data before you use header() or else you will get an error)
3) Write the content of the mysql records as you would an html table. The HTML and table cells will go straight into excel forming a table.
The rest should be cake.
Hope this has helped you. Enjoy!
"At DIC we be content exporting to excel code ninjas! Excel has nothing on us."
This post has been edited by Martyr2: 18 January 2008 - 02:45 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|