db->table('insurers') ->select('insurers.*') // ->select('user_profiles.first_name as user_name') // ->join('user_profiles', 'user_profiles.id = clients.created_by') ->get() ->getResult(); } public function getInsurerName($insurerId) { // Fetch the insurer name based on the insurer ID $query = $this->select('insurers.id,insurers.name, cd_master.cd_ac_no') ->join('cd_master', 'cd_master.insurer_id = insurers.id') ->where('insurers.id', $insurerId) ->get(); if ($query->resultID->num_rows > 0) { $result = $query->getRow(); return $result; } return null; // or handle accordingly if the insurer is not found } }