|
Posted by Nosferatum on March 10, 2008, 6:03 am
Please log in for more thread options
Hi, is it possible to export mysql data to an excel spreadsheet? By
PHP and with a structured, nice layout?
|
|
Posted by Rik Wasmus on March 10, 2008, 6:06 am
Please log in for more thread options
wrote:
show/hide quoted text
> Hi, is it possible to export mysql data to an excel spreadsheet? By
> PHP and with a structured, nice layout?
If the data isn't complicated, I'd go for a simple csv. If there are more
requirements, google 'php excel export': a huge list of possibilities.
--
Rik Wasmus
|
|
Posted by leelu123 on March 10, 2008, 6:17 am
Please log in for more thread options show/hide quoted text
> Hi, is it possible to export mysql data to an excel spreadsheet? By
> PHP and with a structured, nice layout?
Hi,
Check this forum here, I found this useful for above question
http://phptrex.com/index.php/topic,35.0.html
|
|
Posted by Rik Wasmus on March 10, 2008, 6:32 am
Please log in for more thread options
show/hide quoted text
>> Hi, is it possible to export mysql data to an excel spreadsheet? By
>> PHP and with a structured, nice layout?
> Hi,
> Check this forum here, I found this useful for above question
> http://phptrex.com/index.php/topic,35.0.html
... which could better and shorter (fputcsv) as:
//not sure about this first header, but I'll assume it's correct
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: download; filename=3D"download.csv"');
$results =3D mysql_query('select * from tablename');
while($row =3D mysql_fetch_row($results)) fputcsv(STDOUT, $row);
-- =
Rik Wasmus
|
|
Posted by Nosferatum on March 10, 2008, 1:28 pm
Please log in for more thread options show/hide quoted text
> >> Hi, is it possible to export mysql data to an excel spreadsheet? By
> >> PHP and with a structured, nice layout?
> > Hi,
> > Check this forum here, I found this useful for above question
> >http://phptrex.com/index.php/topic,35.0.html
> ... which could better and shorter (fputcsv) as:
> //not sure about this first header, but I'll assume it's correct
> header('Content-type: application/vnd.ms-excel');
> header('Content-Disposition: download; filename="download.csv"');
> $results = mysql_query('select * from tablename');
> while($row = mysql_fetch_row($results)) fputcsv(STDOUT, $row);
> --
> Rik Wasmus
Thank you both, it works!
|
| Similar Threads | Posted | | Export MySQL data to a sql through php | January 26, 2009, 11:28 pm |
| Exporting MySQL Data to Excel using PHP | January 5, 2009, 10:18 am |
| Data Export Grabber | February 23, 2005, 4:48 pm |
| Export data to *.pdf file | June 18, 2007, 5:25 pm |
| I want export data to XL Sheet | March 20, 2009, 5:48 am |
| size limit for xml-files used for import/export of data? | July 27, 2007, 9:36 pm |
| Importing data from Excel into PHP | November 9, 2005, 9:14 pm |
| Exporting data to MS Excel | June 20, 2007, 7:13 am |
| dumping data to excel via https and ie6 broken | August 8, 2005, 6:47 am |
| Any GUI to import/export MySQL? | February 28, 2006, 3:56 am |
|
> PHP and with a structured, nice layout?