467,104 Members | 1,185 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

Export mysql datas to Excelsheet

mageswar005
hi,
I need one help, How can i Export the Datas from mysql to Excelsheet not csv in php coding.The excelsheet format should be comes under microsoft office excel spreadsheet format.i need all this should be in php.I already tried in google but that code has some problem in excelsheet format.

thanks
M.Mageswaran
May 9 '08 #1
  • viewed: 1711
Share:
2 Replies
Atli
Expert 4TB
Hi.

PHP does not provide any functions that can handle Excel files.
You can probably find classes that can handle them however. Try a Google search for Spreadsheet_Excel_Reader. (See this thread for an idea how to use that)

If it is at all possible, I would recommend saving the data as XML, which PHP can handle easily.
May 10 '08 #2
dlite922
Expert 1GB
hi,
I need one help, How can i Export the Datas from mysql to Excelsheet not csv in php coding.The excelsheet format should be comes under microsoft office excel spreadsheet format.i need all this should be in php.I already tried in google but that code has some problem in excelsheet format.

thanks
M.Mageswaran
Your safest and reliable bet would be on CSV.

A few reasons:

CSV is automatically opened by Excel, you can manipulate the header with PHP so that windows doesn't open the file in the browser, but offers a Open/Save/Cancel dialogue to the user.

When exporting data from MySQL, your data does not have *any* formatting (bold, color, margins, font, etc) for you to worry about anyway.

If your user *does* actually change the formatting, upon save they are automatically prompted to save as a .xls file anyway.

export to CSV code is cleaner, simpler, and therefore less buggy and more reliable. Could be alot faster than some solutions you might be heading towards.

-Dan
May 10 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Bob Bedford | last post: by
7 posts views Thread by phillip.s.powell@gmail.com | last post: by
reply views Thread by Jose Angel Campos | last post: by
2 posts views Thread by DurumDara | last post: by
2 posts views Thread by sathyashrayan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.