I need to join two tables but both the table has a field named 'username' both the table has different values i, i need to display both values in the field 'username' how it possible in codeigniter
public function tech_work_completed($id) {
$this->db->select('c.username,u.id,tw.*,w.*');
$this->db->from('tbl_tech_work tw');
$this->db->join('tbl_customers c', 'tw.user_id = c.id', 'left');
$this->db->join('tbl_users u', 'u.id = tw.technician_id', 'left');
$this->db->join('tbl_works w', 'w.user_id = c.id', 'left');
$this->db->where('w.wrk_status', 'completed');
$query = $this->db->get();
return $query->result();
}
this is my model , both table tbl_customer and tbl_users contain a field name username so when display username it get from tbl_user. I need from tbl_customers
$query->result()? It'll be easier to visualise.