我当前的项目中有一个 Owl 滑块,其中最多可显示数据库中的三个图像。我还可以毫无问题地调用我需要的所有数据,但如果我想在滑块中显示 2 或 3 张图片,则仅显示第一张图片,而不会出现错误而不会显示其他图片。
问题是什么?
<div class="container" style="margin-top: 10px;">
<div class="owl-carousel owl-theme">
<?php
$operator_one_id = escape($_GET['operator_one']);
$query = "SELECT * FROM strat WHERE player_one_operator_id = $operator_one_id";
$select_operator_one_strat = mysqli_query($connection, $query);
$row = mysqli_fetch_assoc($select_operator_one_strat);
$player_one_operator_id = $row['player_one_operator_id'];
$player_one_image_top = $row['player_one_image_top'];
$player_one_image_ground = $row['player_one_image_ground'];
$player_one_image_base = $row['player_one_image_base'];
echo "<div class='item'><img src='./assets/img/maps/strats/$player_one_image_top' alt='Operator One Top Strat'></div>";
echo "<div class='item'><img src='./assets/img/maps/strats/$player_one_image_ground' alt='Operator One Ground Strat'></div>";
echo "<div class='item'><img src='./assets/img/maps/strats/$player_one_image_base' alt='Operator Base Strat'></div>";
?>
</div>
</div>
萧十郎
相关分类