Commit 001213bd authored by metzlerd's avatar metzlerd
Browse files

Fixes to not try and iterate if no columns are returned.

parent 6f56ef0b
......@@ -48,10 +48,8 @@ class FrxDrupal extends FrxDataSource {
$select_fields = array();
$rownum = 0;
$xml = new SimpleXMLElement('<table/>');
if ($rs) foreach ($rs as $data) {
if ($rs && $rs->columnCount()) foreach ($rs as $data) {
$rownum++;
$row_node = $xml->addChild('row');
$row_node['num'] = $rownum;
......
......@@ -87,7 +87,7 @@ class FrxPDO extends FrxDataSource {
$i = $db->errorInfo();
FrxReportGenerator::instance()->error($i[2] . ':' . $sql, $i[2]);
}
else if ($rs) {
else if ($rs && $rs->columnCount()) {
$data = $rs->fetchAll(PDO::FETCH_ASSOC);
$rownum = 0;
......
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