好的,所以我意识到什么时候做://connectioncode;//querycode;//$result=mysqli_query();$row=mysqli_fetch_array($result);您创建一个关联数组,其中表中的列名是相应行中数据的键。然后你可以使用:while($row=mysqli_fetch_array($result)){//codetoechoouttabledata.}我的问题是while循环如何在每次迭代后转到下一行?我以为这就是foreach循环的用途? 最佳答案 来自http://www.ph