Login   Register  
PHP Classes
elePHPant
Icontem

File: export_simple.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Charles A. LaFleur  >  Export Spreadsheets  >  export_simple.php  >  Download  
File: export_simple.php
Role: Example script
Content type: text/plain
Description: Simple export example
Class: Export Spreadsheets
Create Excel spreadsheet from data in MySQL table
Author: By
Last change: Updated for v2.3.
Date: 2 years ago
Size: 1,008 bytes
 

Contents

Class file image Download
<?php

// include the export_spreadsheet_class
require_once ("export_spreadsheets_class.php");

// create an instance of the export_spreadsheet_class object
$myExportSimple = new exportSpreadsheets();

// set instance properties
$myExportSimple->mysqlServer "localhost";
$myExportSimple->mysqlUsername "exportUser";
$myExportSimple->mysqlPassword "exportPassword";
$myExportSimple->mysqlDatabaseName "export_spreadsheets";
$myExportSimple->mysqlTableName "export_table";

// create an empty array of worksheets
// passing an empty array will cause the class to create a single worksheet
// containing all fields.  The column titles will be the field names.
// The worksheet rows will be listed in the order they are listed in the database table 
$simple_workbook_array "";

// assign a name for the Excel spreadsheet
$simple_workbook_name "simple.xls";

// export the spreadsheet
$myExportSimple->export_spreadsheets($simple_workbook_name,$simple_workbook_array);

?>