In my quiz system I am trying to actually now make the page of the questions, but it shows nothing when I try to show the question rows and the answer rows to the page.
<?php
$q_qselect = mysql_query("SELECT * FROM `questions`");
$q_qnumrows = mysql_num_rows($q_select);
for($i=0;$i<$q_qnumrows;$i++){
$q_qselect = mysql_query("SELECT * FROM `questions` WHERE `id`='$i'");
$q_aselect = mysql_query("SELECT * FROM `answers` WHERE `question_id`='$i'");
$q = mysql_fetch_assoc($q_qselect);
$a = mysql_fetch_assoc($q_aselect);
echo $q['question'] . "<br />";
echo $a['answer'] . "<br />";
}
?>
And also, another question - how can I actually check that he selected the correct answer? (radio button near each answer) when the field in the answers table is correct
?