简体   繁体   English

如何使用幻灯片在php中显示数据库中的多个图像

[英]how to display multiple images in php from database using slideshow

I have images that have been uploaded from a database but I want the images to be in a slideshow my code :我有从数据库上传的图像,但我希望图像以幻灯片形式显示我的代码:

while ($row2=mysqli_fetch_array($res2))
        {
          $image=$row2 ['img_name'];
          echo'
                  <td>
                  <img src="../photo/'.$image.'" width="360" height="150">
                  </td>';
        }
 <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
 <div class="carousel-inner">
     while ($row2=mysqli_fetch_array($res2))
       {
         $image=$row2 ['img_name'];
         echo'                    
          <div class="carousel-item active">         
                <img src="../photo/'.$image.'" width="360" height="150">                   
           </div> ';
         }
  </div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM