我想在我的网页中使用Bootstrap http://www.bootply.com/81478中的缩略图滑块。为了从数据库中获取所有图像,这就是我获取和回显它们的方式:
<?php while ($rowz = mysqli_fetch_array($result3)) {
?><img width="150"src="images/<?php echo $rowz['image']; ?><?php}?>
然而,从上面给出的链接中的以下示例中,图像显然是硬编码的示例。我尝试插入这样的代码行,但它给了我多个滑块,其中只有一个图像。我如何解决这个问题,以便我从数据库中获取的所有图像作为一行进入此滑块?
<?php while ($rowz = mysqli_fetch_array($result3)) { <--fetch by loop-->
?>
<div class="container">
<div class="col-md-12">
<h1>Bootstrap 3 Thumbnail Slider</h1>
<div class="well">
<div id="myCarousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<img width="150"src="images/<?php echo $rowz['image']; ?><?php}?> <--echo here-->
</div>
</div>
<!--/row-->
</div>