[eluser]code_has_been_ignited[/eluser]
hey,
Something just is not coming to me and I hope someone can provide some assistance to my issue.
I am trying to load a question and then display multiple answers for that question. My issue is I cannot seem to load more then 1 question and answer set. This is what my code looks like in my model:
Code:
public function getQuestions($quiz_id)
{
$query = $this->db->query('SELECT * FROM '.$this->quiz_questions.' WHERE question_for = '.$quiz_id.'');
return $query;
}
public function getAnswers($quest_id)
{return $this->db->query('SELECT * FROM '.$this->quiz_answers.' WHERE question_id = '.$quest_id.'');
}
My View Has:
Code:
foreach ($question->result() as $questionw) {
echo $questionw->question;
}
foreach ($answers->result() as $row) {
echo "<input type=\"radio\" name=\"choice\" value=\"".$row->refrence."\"/>" . $row->answer . "";
}
I am trying to keep tight with the MVC pattern and I am relatively new to codeigniter and any hints and tips would be great.
Thanks You