tableNameDB} as NRDS LEFT JOIN {$this->db->tblLocation} as Location ON Location.id = NRDS.id_owner AND Location.nrds_id = NRDS.id WHERE NRDS.record_type = 'location' AND Location.id IS NULL UNION SELECT NRDS.* FROM {$this->tableNameDB} as NRDS LEFT JOIN {$this->db->tblMember} as Member ON Member.id = NRDS.id_owner AND Member.nrds_id = NRDS.id WHERE NRDS.record_type = 'individual' AND Member.id IS NULL "; $res = $this->db->queryAll($sql); $this->isDBError($res); return $res; } function isBlocked($nrds_id) { $sql = " SELECT NRDS.* FROM {$this->tableNameDB} as NRDS LEFT JOIN {$this->db->tblLocation} as Location ON Location.id = NRDS.id_owner AND Location.nrds_id = NRDS.id WHERE NRDS.record_type = 'location' AND Location.id IS NULL AND NRDS.id = " . S_db2::quoteBigInt($nrds_id) . " UNION SELECT NRDS.* FROM {$this->tableNameDB} as NRDS LEFT JOIN {$this->db->tblMember} as Member ON Member.id = NRDS.id_owner AND Member.nrds_id = NRDS.id WHERE NRDS.record_type = 'individual' AND Member.id IS NULL AND NRDS.id = " . S_db2::quoteBigInt($nrds_id); if (null === $this->db->queryRow($sql)) { return false; } return true; } }