Jump to content

Export to Excel


argrafic

Recommended Posts

okay, you may be able to do it the easiest way: output a tab-delimited file with a .xls extension something like:

 

$data = "";

while (list($field1_val, $field2_val, $field3_val) = mysql_fetch_row($result)) {
     $data .= "$field1_val\t$field2_val\t$field3_val\n";
}

 

then write $data to a file with a .xls extension. if you need to format cells and stuff, you'll probably want to look into this Pear thing:

 

http://pear.php.net/package/Spreadsheet_Excel_Writer/redirected

 

I use it with great results.

Link to comment
https://forums.phpfreaks.com/topic/103881-export-to-excel/#findComment-532116
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.