'required', 'user_id' => 'required', 'answer' => 'required', 'question_id' => 'required', ]; public function getRespuestas($survey_id, $user_id) { $db = db_connect(); $where = 'answers.survey_id = ' . $db->escape($survey_id) . ' AND answers.user_id = ' . $db->escape($user_id); return $this ->select('answers.id, answers.survey_id, answers.user_id, answers.answer,answers.question_id, questions.question, questions.type') ->join('questions', 'answers.question_id = questions.id') ->where($where) ->findAll(); } }