在引导carousel中导入mysql图像

ecbunoof  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(420)

如主题所示,我在一个专栏中插入了一些图片链接。我想把它们添加到一个引导旋转木马中,但问题是有三个图像,所有的图像都在另一个下面。我的代码会解释一切。希望得到答案,这就是我所能解释的!谢谢您!

<!DOCTYPE html>
<html>
<head>
    <title>CineMate - AhadAman</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

</head>
<body>
<!--   
       CAROUSEL    -->
       <?php
       include_once('admins/conn.php');
       $select = "SELECT * FROM slide_show";
       $run = mysqli_query($conn,$select);
       while ($row = mysqli_fetch_array($run)) {

       ?>
      <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img class="d-block w-100" src="<?php echo $row['img_url']; ?>" alt="First slide">
    </div>

  </div>
  <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
<!-- 
       CAROUSEL END -->
       <?php
    }
    ?>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</body>
</html>
prdp8dxp

prdp8dxp1#

要从mysql显示图像,请尝试以下操作

<img class="d-block w-100" src="data:image/jpeg;base64,<?php echo base64_encode($row['img_url']); ?>" alt="First slide">

相关问题