Commit f8b0ad9d authored by metzlerd's avatar metzlerd
Browse files

Added rownum attribute to all rows generated manuallly

parent 48561540
......@@ -46,11 +46,15 @@ class FrxDrupal extends FrxDataSource {
$rs = db_query($sql);
$entity_map = array();
$select_fields = array();
$rownum = 0;
$xml = new SimpleXMLElement('<table/>');
foreach ($rs as $data) {
$rownum++;
$row_node = $xml->addChild('row');
$row_node['num'] = $rownum;
/* If we are querying entities, we will store away IDs
* for later querying and XML processing in the
* loadEntitys method
......
......@@ -117,9 +117,11 @@ class FrxMSSQL extends FrxDataSource {
$xml = new SimpleXMLElement('<table/>');
$rs = mssql_query($sql, $db);
$rownum = 0;
while ($row = mssql_fetch_assoc($rs)) {
$rownum++;
$row_node = $xml->addChild('row');
$row_node['num'] = $rownum;
foreach ($row as $key => $value) {
$row_node->addChild(strtolower($key), htmlspecialchars($value));
}
......
......@@ -140,9 +140,12 @@ class FrxOracle extends FrxDataSource {
//$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));
}
......
......@@ -91,8 +91,11 @@ class FrxPDO extends FrxDataSource {
//$rs->debugDumpParams();
$data = $rs->fetchAll(PDO::FETCH_ASSOC);
$rownum = 0;
foreach ($data as $row) {
$rownum++;
$row_node = $xml->addChild('row');
$row_node['num'] = $rownum;
foreach ($row as $key => $value) {
$row_node->addChild($key, htmlspecialchars($value));
}
......
......@@ -110,9 +110,11 @@ class FrxPostgres extends FrxDataSource {
$db = $this->db;
$xml = new SimpleXMLElement('<table/>');
$rs = pg_query($sql);
$rownum = 0;
if ($rs) while ($row = pg_fetch_assoc($rs)) {
$rownum++;
$row_node = $xml->addChild('row');
$row_node['num'] = $rownum;
foreach ($row as $key => $value) {
$row_node->addChild(strtolower($key), htmlspecialchars($value));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment