Trying to fill up a bootstrap carousel with multiple images from database,this is my code yet but doesnt seem to work. Im using PHP PDO,so got a query fetched before what my foreach based on.The query is fine cause without the carousel it lists the images as should be.The issue lays within these lines.
<?php
$stmt = $pdo->prepare("SELECT * FROM images");
$stmt->execute();
$image = $stmt->fetchAll();
?>
<?php foreach($image as $images)
{
?>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="/upload/<?php echo $images['image']?>" alt="First slide">
</div>
<div class="carousel-item">
<?php
}
?>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="false"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="false"></span>
<span class="sr-only">Next</span>
</a>