db_add_param($pruefling_id, FHC_INTEGER); if($this->db_query($qry)) { if($row = $this->db_fetch_object()) { $this->prueflinggebiet_id = $row->prueflinggebiet_id; $this->pruefling_id = $row->pruefling_id; $this->gebiet_id = $row->gebiet_id; return true; } else { $this->errormsg = "Pruefling nicht gefunden"; return false; } } else { $this->errormsg = "Fehler beim Laden der Gebiete für den Pruefling"; return false; } } public function checkIfExists($pruefling_id, $gebiet_id) { $qry = "SELECT 1 FROM testtool.tbl_pruefling_gebiet WHERE pruefling_id =".$this->db_add_param($pruefling_id, FHC_INTEGER) ." AND gebiet_id =".$this->db_add_param($gebiet_id, FHC_INTEGER); if ($result = $this->db_query($qry)) { if ($this->db_num_rows($result) > 0) return true; else return false; } } public function saveGebietForPruefling() { $qry = "INSERT INTO testtool.tbl_pruefling_gebiet (pruefling_id, gebiet_id) VALUES(". $this->db_add_param($this->pruefling_id, FHC_INTEGER).','. $this->db_add_param($this->gebiet_id, FHC_INTEGER).');'; if ($this->db_query($qry)) { return true; } else { $this->errormsg = 'Fehler beim Speichern der Daten'; return true; } } } ?>