我在从MySQL表中检索数据时遇到问题。我的脚本只检索一行,这是我table的最后一行,其中 table 包含 12 个填充行。我的目标是检索表中的所有行。
这是我认为问题源于的代码部分:
<?php
//Grabs the whole queston list
$question_list="";
$sql = mysqli_query($link,"SELECT * FROM DebateQuestion") or die(mysql_error());;
$questionCount = mysqli_num_rows($sql);// count the output amount
if($questionCount>0){
while($row = mysqli_fetch_array($sql, MYSQLI_ASSOC)){
$id = $row["qQuestionNo"];
$question = $row["qQuestion"];
$venue = $row["qDebateVenue"];
$date = $row["qDate"];
$question_list = "$id. $question <a href='#'>Edit</a> •<a href='#'>Delete</a><br/>";
}
}else{
$question_list = "There are no questions in the inventory yet";
}
?>