嗨,大家好,我想知道你是否可以帮助我在我的while循环中递增.我正在使用php编写在线测验,并希望每次选择提交按钮时更新qustion编号,但变量$ questionNumber只保留在一个
我的代码如下所示
World Cup Quiz World Cup Quiz
"; //Assign variables to each attribute while ($dbRow=mysql_fetch_array($dbResult)) { $theID=$dbRow["ID"]; $theQuestion=$dbRow["Question"]; $theAnswer1=$dbRow["Correct Answer"]; $theAnswer2=$dbRow["Wrong Answer 1"]; $theAnswer3=$dbRow["Wrong Answer 2"]; $theAnswer4=$dbRow["Wrong Answer 3"]; $_SESSION['number']=$questionNumber+1; } //Print Questions and Answers echo ''."$theQuestion".'
'; ?>
希望你能帮忙
谢谢