db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); $this->db->where('LO.ID', $requestedBy); $studentDetails = $this->db->get()->first_row(); if($studentDetails){ $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID); } else{ $result['studentStatus'] = false; $result['studentInfo'] = ""; } return $result; } /* * get student course details * created by kms * */ public function getStudentCourse($studentId=null){ $this->db->select('CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,BA.BatchName'); $this->db->from( STUDENTCOURSE . ' as SCU'); $this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID'); $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID'); $this->db->join( BATCH . ' as BA', 'BA.BatchCode = SCU.BatchCode'); $this->db->where('SCU.StudentID', $studentId); $courseDetails = $this->db->get(); return $courseDetails->result(); } }