File: sample.php

Recommend this page to a friend!
  Classes of fridayana baabullah  >  PEAR WorkBook Helper  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample Usage
Class: PEAR WorkBook Helper
Generate an Excel spreadsheet with MySQL results
Author: By
Last change: memotong comment menjadi 2 baris
Date: 10 years ago
Size: 920 bytes


Class file image Download
require_once 'anysqltoexcel.php';

$sqlSheetList = array(
WorkbookUtil::createSqlSheet('Sheet 1', "select * from table1"),
WorkbookUtil::createSqlSheet('Sheet 2', "select field1, field2 from table2 where field2 = 'x' order by field2 limit 0,50"),
WorkbookUtil::createSqlSheet('Sheet Tiga', "select count(field) as jumlah from table3")

// Anda dapat membuat implementasi SqlExplorer sendiri misalnya untuk oracle.
// Kami hanya menyediakan contoh implementasi SqlExplorer untuk mysql
$sqlExplorer = new MysqlSqlExplorer('localhost', 'root', 's3cr3tp455w0rd', 'dbname');
$writerCallback = new DefaultWriterCallback();

$pearWorkBookHelper = new PearWorkBookHelper();
$workbook =& $pearWorkBookHelper->createWorkBook($sqlSheetList);

For more information send a message to info at phpclasses dot org.