[eluser]defectivereject[/eluser]
i solved it, just needed some additional where statements
Code:
$this->db->select('s_id, r_id, qu_id, staff_id, qual_id, qualification, required_by' );
$this->db->from('required_roles');
$this->db->join('staff', 'required_roles.role_id = staff.r_id', 'INNER');
$this->db->join('records', 'required_roles.qu_id = records.qual_id', 'left outer');
$this->db->join('qualification', 'qu_id = q_id', 'left outer');
$this->db->where('s_id', $this->uri->segment(3));
$this->db->where('staff_id <>', $this->uri->segment(3));
$this->db->where('staff_id IS NOT NULL');
$this->db->or_where('s_id', $this->uri->segment(3));
$this->db->where('staff_id', NULL );
$this->db->order_by('qu_id', 'DSC');
thanks for the help anyways!