$query = "SELECT s.id, s.name, COUNT(c.id) AS numcat FROM #__sections s"; if ($pg) { $query .= "\n LEFT JOIN #__categories c ON c.section=s.id::VARCHAR"; } else { $query .= "\n LEFT JOIN #__categories c ON c.section=s.id"; }
$ordrivers = array('oci8', 'oci805', 'oci8po', 'oracle'); $query = "SELECT s.id, s.name, COUNT(c.id) AS numcat FROM #__sections s"; if ($pg) { $query .= "\n LEFT JOIN #__categories c ON c.section=s.id::VARCHAR"; } if (in_array($database->_resource->databaseType,$ordrivers)){ $query .= "\n LEFT JOIN #__categories c ON c.section= TO_CHAR(s.id)"; } else { $query .= "\n LEFT JOIN #__categories c ON c.section=s.id"; }