ExcelWriterXML
[ class tree: ExcelWriterXML ] [ index: ExcelWriterXML ] [ all elements ]

Source for file example3_db.php

Documentation is available at example3_db.php

  1. <?php
  2. /**
  3.  * Example using built in MYSQL DB functions
  4.  * @package ExcelWriterXML
  5.  * @subpackage examples
  6.  * @filesource
  7.  */
  8.  
  9. include('ExcelWriterXML.php');
  10. $xml new ExcelWriterXML('my file.xml');
  11. $xml->showErrorSheet(true);
  12. /*****************  ADD multiple tables all at once ***********/
  13. $tables array(
  14.     'test',
  15.     'desks',
  16. );
  17. $xml->mysqlTableDump('surveys.web.alcatel-lucent.com','ghdweb','ghdweb','ghdweb_survey',$tables);
  18.  
  19. /*****************  ADD one table at a time ***********/
  20. $xml->mysqlTableDump('surveys.web.alcatel-lucent.com','ghdweb','ghdweb','ghdweb_survey','test','test2');
  21. $xml->mysqlTableDump('surveys.web.alcatel-lucent.com','ghdweb','ghdweb','ghdweb_survey','desks','desk2');
  22.  
  23. /*****************  ADD a sheet, execute a query against that sheet ***********/
  24. $qSheet $xml->addSheet('My Query');
  25. $query '
  26.     SELECT
  27.         datetime as "Date and Time"
  28.         ,`int` as "Integer"
  29.     FROM
  30.         test
  31. ';
  32. $qSheet->mysqlQueryToTable('surveys.web.alcatel-lucent.com','ghdweb','ghdweb',$query);
  33. $xml->sendHeaders();
  34. $xml->writeData();
  35. ?>

Documentation generated on Wed, 16 Feb 2011 20:04:33 -0600 by phpDocumentor 1.4.3