query('SELECT * FROM answers INNER JOIN questions
WHERE answers.answerId= questions.questionId AND answers.answerId IN (' . $id . ')')
I need help to change this to active record for codeigniter.
i tried to get the values which is equal to the id form the two tables and join it. but when i tried like this
$this->db->select("*"); $this->db->join("questions","questions.questionId = answers.answerId"); $this->db->where_in('answers.answerId',$id); $res = $this->db->get("answers");
It's only displaying the first joined table passed through the id.
$this->db->select("*"); $this->db->join("questions","questions.questionId = answers.answerId"); $this->db->where_in('answers.answerId',$id); $res = $this->db->get("answers");
It's only displaying the first joined table passed through the id. – Kohli