I’ve created a web app using code igniter 3 to get data from 3 tables and display them in the view (quiz_table,question_table and answers_table).
Below is the model code,
function getSingleQuizQuestionDataFromDB($quizId)
{ //insert query
try {
$this->db->select('quiz_table.quizName');
$this->db->select('quiz_table.creatorName');
$this->db->select('quiz_table.rating');
$this->db->select('question_table.questionId');
$this->db->select('question_table.questionTitle');
$this->db->select('question_table.correctAnswer');
$this->db->select('answer_table.answer');
$this->db->from('quiz_table');
$this->db->where('quiz_table.quizId',$quizId);
$this->db->join('question_table','question_table.quizId = quiz_table.quizId','INNER');
$this->db->join('answer_table','answer_table.questionId= question_table.questionId','INNER');
$this->db->from('quiz_table');
$this->db->group_by(['quiz_table.quizId', 'question_table.questionId']);
$result = $this->db->get();
$singleQuizQuestionData= $result->result_array();
return $singleQuizQuestionData;
} catch (Exception $e) {
// log_message('error: ',$e->getMessage());
return;
}
}
When I try to load the result I get the below error

Please help!