I want to return some data from my database with Codeigniter. The query is a join from all related tables.
Here is teh diagram:
The join query from the model:
public function combine_all_data_related($hostname){
$this->db->select('*');
$this->db->from('workstations w');
$this->db->join('occupations o', 'w.occupation_id = o.occupation_id', 'left');
$this->db->join('departments d', 'd.department_id = o.department_id', 'left');
$this->db->join('workstation_configuration wc', 'wc.service_tag = w.service_tag', 'left');
$this->db->join('workstation_models wm', 'wm.workstation_model_id = wc.workstation_model_id', 'left');
$this->db->join('workstation_types wt', 'wt.workstation_type_id = wm.workstation_type_id', 'left');
$this->db->join('users u', 'u.occupation_id = o.occupation_id', 'left');
$this->db->join('phone_numbers pn', 'pn.fmid = u.fmid', 'left');
$this->db->join('phones p', 'p.phone_number_id = pn.phone_number_id', 'left');
$this->db->join('phone_brands pb', 'pb.phone_brand_id = p.phone_brand_id', 'left');
$this->db->where("w.hostname = '" . $hostname . "'");
$query = $this->db->get();
return $return = $query->result();
}
In the database, I have this record:

And in-browser here are the var_dumps results SQL statement and returned data. The records that are not OK acquisition date, latest edit, and status.
