我正在尝试制作一个测验系统,但它输出:
Question1
Answer1
Question1
Answer2
等等..而不是
Question1
Answer1
Answer2
... and so on
我该如何解决?
代码:
$question = mysql_query("SELECT questions.*, answers.* FROM questions inner join answers on questions.id=answers.question_id");
while($row = mysql_fetch_assoc($question))
{
echo $row['question'].'<br />' .$row['answer'].'<br />';
}