You are here: Re: excel export - few options « PHP SQL « IT news, forums, messages
Re: excel export - few options

Posted by Mike G. on 07/19/06 00:39

You're on the right track.

You'll need to have an export script that will send the appropriate
header to tell the browser to download the document rather than to
display it. This is exemplified on the header function's page
(http://www.php.net/header).

I would start with something simple: CSV. It's nothing more than a set
of data separated by commas. The only headache would be if your data
could potentially contain commas (say a "description" field). Then an
escaping routine will need to be planned.

Cheers,
Mike G.

toffee wrote:
> Hi all,
>
> i have a simple php script which pulls data from mysql db and displays it. i
> would like to add the option to export the displayed table to an excel
> spreadsheet with the click of a button.
> i've done some googling and it seems the best way is to call onclick a
> seperate php file with the excel header which will then prompt user to save
> file.
> since am n00b, i appreciate its a bit longwinded so my question is: is there
> a better and efficient way since the data has already been retrieved; why go
> again an retrieve it ?
>
> all suggestions are appreciated

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация