I have a simple CodeIgniter Active record query to select an ID:
$q = $this -> db
-> select(\'id\')
-> where(\'email\', $email
public function getSalary()
{
$this->db->select('tbl_salary.*,tbl_employee.empFirstName');
$this->db->from('tbl_salary');
$this->db->join('tbl_employee','tbl_employee.empID = strong texttbl_salary.salEmpID');
$this->db->where('tbl_salary.status',0);
$query = $this->db->get();
return $query->result();
}