private function FrxMSSQL::php_xml in Forena Reports 6
Same name and namespace in other branches
- 6.2 plugins/FrxMSSQL.inc \FrxMSSQL::php_xml()
- 7 plugins/FrxMSSQL.inc \FrxMSSQL::php_xml()
- 7.2 plugins/FrxMSSQL.inc \FrxMSSQL::php_xml()
- 7.3 plugins/FrxMSSQL.inc \FrxMSSQL::php_xml()
- 7.4 plugins/FrxMSSQL.inc \FrxMSSQL::php_xml()
1 call to FrxMSSQL::php_xml()
- FrxMSSQL::data in plugins/FrxMSSQL.inc 
- Get data based on file data block in the repository.
File
- plugins/FrxMSSQL.inc, line 111 
- Oracle specific driver that takes advantage of oracles native XML support
Class
- FrxMSSQL
- @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 = mssql_query($sql);
  while ($row = mssql_fetch_assoc($rs)) {
    $row_node = $xml
      ->addChild('row');
    foreach ($row as $key => $value) {
      $row_node
        ->addChild(strtolower($key), htmlspecialchars($value));
    }
  }
  if ($rs) {
    mssql_free_result($rs);
  }
  return $xml;
}