Mysqli数组错过了第一个返回的行... 它应该首先返回第22行,但应从23开始。。。
<!-- Event Loop -->
//Controller
// Show events of current user, upon click change value $_SESSION['eid']
$uid = $_SESSION['uid'];
//$eid = $_SESSION['eid'];
$sql = "SELECT *
FROM events";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while ($row = $result->fetch_assoc()) {
echo " <div class='card mb-3'> ";
echo " <div class='card-header'> ";
echo " <i class='fas fa-table'></i> ";
echo " Eventname</div> ";
echo " <div class='card-body'> ";
echo "<pre>";
print_r(mysqli_fetch_array($result));
echo "</pre>";
echo "<img src='../eventimages/" . $row["image"] . "' width='100%' height='25%'>";
echo " ";
echo " </div> ";
echo " <div class='card-footer small text-muted'>Updated yesterday at 11:59 PM</div> ";
echo " </div> ";
echo " ";
}
}
mysqli_close($con);
第一个条目应为22,但应从23开始。