Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old May 9th, 2008, 03:15 PM
mageswar005's Avatar
Member
 
Join Date: Mar 2008
Location: chennai
Age: 27
Posts: 58
Default Export mysql datas to Excelsheet

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
Reply
  #2  
Old May 10th, 2008, 04:19 AM
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Age: 22
Posts: 2,790
Default

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.
Reply
  #3  
Old May 10th, 2008, 08:37 AM
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Age: 23
Posts: 673
Default

Quote:
Originally Posted by 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
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
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles