PHP Classes

sql2excel: Easy way to stream Mysql sql content to Excel.

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 53%Total: 8,228 This week: 1All time: 209 This week: 560Down
Version License PHP version Categories
sql2excel 1.0.6GNU Lesser Genera...3Databases, Files and Folders
Description 

Author

This package can generate Excel files from data values or data from MySQL.

It provides one base class that can generate Excel files from given values for its spreadsheet cells.

A sub-class can import data from given MySQL query results.

The generated Excel files are served for download.

Picture of Erh-Wen,Kuo
Name: Erh-Wen,Kuo <contact>
Classes: 2 packages by
Country: United States United States
Age: ???
All time rank: 28335 in United States United States
Week rank: 411 Down48 in United States United States Down

Example

<?php
   
/*
     * @version V1.0 2002/July/18 (c) Erh-Wen,Kuo (erhwenkuo@yahoo.com). All rights reserved.
     * Released under both BSD license and Lesser GPL library license.
     * Whenever there is any discrepancy between the two licenses,
     * the BSD license will take precedence.
     *
     * purpose: This is a example how to use "sql2excel" class to write mysql sql content
     * to excel file format and stream the output to user's browser directly.
     */
    
   
include_once('sql2excel.class.php');
       
   
//the query string you want to show
   
$query="Select * From employees";
   
   
//setup parameters for initiating Sql2Excel class instance
    //modify your mysql connection parameters & database name below:
   
$db_host="localhost";
   
$db_user="";
   
$db_pwd="";
   
$db_dbname="xcompany";
   
   
//initiating Sql2Excel class instance
   
$excel=new Sql2Excel($db_host,$db_user,$db_pwd,$db_dbname);
   
//Output excel file to user's browser
   
$excel->ExcelOutput($query);
    echo
"<h1>Exel Generate Completed!!</h1>";
?>


  Files folder image Files  
File Role Description
Plain text file excelgen.class.php Class This is the base class for excel generating.
Accessible without login Plain text file excelgen_example.php Example This is a simple demo showing how to use 'excelgen' class.
Plain text file sql2excel.class.php Class This is the main class turning mysql sql content to excel.
Accessible without login Plain text file sql2excel_example.php Aux. This is a demo for 'sql2excel' class.
Accessible without login Plain text file sql2excel_example1.php Example This is anoter demo of 'sql2excel'.
Accessible without login Plain text file sql2excel_example2.php Example This is another demo for 'sql2excel' class.

 Version Control Unique User Downloads Download Rankings  
 0%
Total:8,228
This week:1
All time:209
This week:560Down
User Ratings User Comments (2)
 All time
Utility:90%StarStarStarStarStar
Consistency:81%StarStarStarStarStar
Documentation:-
Examples:-
Tests:-
Videos:-
Overall:53%StarStarStar
Rank:2223
 
This Class Is Not Support UTF8 But Thanks .
12 years ago (amirkh)
57%StarStarStar
great work :)
13 years ago (shangraj)
60%StarStarStarStar