id = $id; $this->fetch_data(); } protected function fetch_data(){ global $dbh; if ($this->id) { $query = "select * from scan_request_priorities where id_scan_request_priority = ".$this->id; $result = pmb_mysql_query($query, $dbh); if(pmb_mysql_num_rows($result)){ $row = pmb_mysql_fetch_object($result); $this->label = $row->scan_request_priority_label; $this->weight = $row->scan_request_priority_weight; } } } public function get_id() { return $this->id; } public function get_label() { return $this->label; } }