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