增量在php while循环中

 1911530988com 发布于 2023-02-12 00:18

嗨,大家好,我想知道你是否可以帮助我在我的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".'
'; ?>
$theAnswer2"; ?> $theAnswer3"; ?> $theAnswer4"; ?>

希望你能帮忙

谢谢

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有