db->select('p.*,d.name as deptname,s.name as studentName,f.name as facultyName'); $this->db->from('project as p'); $this->db->join('department as d','d.id=p.department','left' ); $this->db->join('student as s','s.id=p.student','left' ); $this->db->join('faculty as f','f.id=p.faculty','left' ); $this->db->where(array('p.status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function get_pro($id) { $this->db->select('*'); $this->db->from('project'); $this->db->where(array('status'=>1,'id'=>$id)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function get_dep() { $this->db->select('*'); $this->db->from('department'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function get_stu() { $this->db->select('*'); $this->db->from('student'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } function get_fac() { $this->db->select('*'); $this->db->from('faculty'); $this->db->where(array('status'=>1)); $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } }