id_location = intval($id_location); $this->empr_location = intval($empr_location); $this->fetch_data(); } protected function fetch_data() { $this->data = array(); $query = "SELECT resa_loc, resa_emprloc FROM resa_loc"; $result = pmb_mysql_query($query); if(pmb_mysql_num_rows($result)) { while ($row = pmb_mysql_fetch_object($result)) { $this->data[$row->resa_emprloc][] = $row->resa_loc; } } } public function get_data() { return $this->data; } }