开发者

how can i generate a exl file having all data values from database

开发者 https://www.devze.com 2023-03-01 15:34 出处:网络
i am having a button on clicking thisi want to generate a exl file having all data values which i ha开发者_如何转开发ve in a table comming from databse..please help meHave a look at this PEAR package:

i am having a button on clicking this i want to generate a exl file having all data values which i ha开发者_如何转开发ve in a table comming from databse..please help me


Have a look at this PEAR package:

Spreadsheet_Excel_Writer

In case you have knowledge of windows technology, have a look at PHP's COM libary:

http://php.net/manual/de/book.com.php


Use a library such as PHPExcel, or one of the alternatives to PHPExcel listed in this thread

EDIT

The answer to this question demonstrates how to do what you're asking: reading data from a database and writing it to Excel


If you just want some simpel columns & rows without any special design



header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"export.csv\"");

$data.="col1, col2 ... from your database";
echo $data; 


You can import csv into excel.

0

精彩评论

暂无评论...
验证码 换一张
取 消