You are here

private function FrxOracle::php_xml in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 plugins/FrxOracle.inc \FrxOracle::php_xml()
  2. 6 plugins/FrxOracle.inc \FrxOracle::php_xml()
  3. 7 plugins/FrxOracle.inc \FrxOracle::php_xml()
  4. 7.2 plugins/FrxOracle.inc \FrxOracle::php_xml()
  5. 7.4 plugins/FrxOracle.inc \FrxOracle::php_xml()
1 call to FrxOracle::php_xml()
FrxOracle::sqlData in plugins/FrxOracle.inc
Get data based on file data block in the repository.

File

plugins/FrxOracle.inc, line 141
Oracle specific driver that takes advantage of oracles native XML support

Class

FrxOracle
@file Oracle specific driver that takes advantage of oracles native XML support

Code

private function php_xml($sql) {
  $db = $this->db;
  $xml = new SimpleXMLElement('<table/>');

  //$rs->debugDumpParams();
  $stmt = oci_parse($db, $sql);
  oci_execute($stmt);
  $rownum = 0;
  while ($row = oci_fetch_array($stmt, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS)) {
    $rownum++;
    $row_node = $xml
      ->addChild('row');
    $row_node['num'] = $rownum;
    foreach ($row as $key => $value) {
      $row_node
        ->addChild(strtolower($key), @htmlspecialchars($value));
    }
  }
  oci_free_statement($stmt);
  return $xml;
}