Hello to all,
I am trying to display the images on my page through php from mysql database
Problem is - Images are repeating , It always display only first image.
<?php include("header.php");
include("connection.php");
$sql = "select Image from flood_light";
$result = $conn -> query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
?>
<!--header//-->
<div class="product-model">
<div class="container">
<ol class="breadcrumb">
<li><a href="index.html">Home</a></li>
<li class="active">Products</li>
</ol>
<div class="col-md-9 product-model-sec">
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<?php echo '<img src="images/'.$row[1].'"/>'; ?>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<?php echo '<img src="images/'.$row[2].'"/>'; ?>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood3.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div> </a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood4.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood5.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<!-- <span class="item_price">$187.95</span> -->
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
<!-- <p class="disc">[12% Off]</p> -->
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood6.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Flood Light</h4>
<!-- <span class="item_price">$187.95</span> -->
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
<!-- <p class="disc">[12% Off]</p> -->
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood7.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Marvel Flood Light</h4>
<!-- <span class="item_price">$187.95</span> -->
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
<!-- <p class="disc">[12% Off]</p> -->
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood8.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Regal Flood Light</h4>
<!-- <span class="item_price">$187.95</span> -->
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
<!-- <p class="disc">[12% Off]</p> -->
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
<a href="single.html"><div class="product-grid">
<div class="more-product"><span> </span></div>
<div class="product-img b-link-stripe b-animate-go thickbox">
<img src="images/flood9.jpg" class="img-responsive" alt=""/>
<div class="b-wrapper">
<h4 class="b-animate b-from-left b-delay03">
<button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button>
</h4>
</div>
</div></a>
<div class="product-info simpleCart_shelfItem">
<div class="product-info-cust prt_name">
<h4>Audi Flood Light</h4>
<!-- <span class="item_price">$187.95</span> -->
<div class="ofr">
<p class="pric1"><del>Rs 280</del></p>
<!-- <p class="disc">[12% Off]</p> -->
</div>
<input type="text" class="item_quantity" value="1" />
<input type="button" class="item_add items" value="ADD">
<div class="clearfix"> </div>
</div>
</div>
</div>
</div>
<?php include("sidebar.php"); ?>
<!--script-->
<!---->
<div class="subscribe">
<div class="container">
<h3>Newsletter</h3>
<form>
<input type="text" class="text" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}">
<input type="submit" value="Subscribe">
</form>
</div>
</div>
<!---->
<?php
}
} else {
echo "0 results";
}
include("footer.php"); ?>