I have a "file upload" and needed to show it in a carousel. The path of the images is stored in the database and the images in a folder, of course. I have the following code:
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
<li data-target="#myCarousel" data-slide-to="3"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php
$con = mysqli_connect("localhost","root","","saber");
mysqli_set_charset($con,"utf-8");
$result = mysqli_query($con,"select * from banners");
while($row = mysqli_fetch_array($result)){
$img = $row['imagem'];
echo "<div class='item active'>
<img src='php/$img'>
</div>";
}
?>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
And when I go to test the images appear one below the others. And I can not see what the error is!
I got the code for the carusel here and the carousel should be as shown in the example link I mentioned above, but it looks like this:
IreallyneedtohavethisreadytodayandsinceI'veneverworkedwithcarouselinphpanddatabase.SoI'llputthe whole page code .
And at Ricardo's request here is html rendering
PS: I did not do this so I may not be able to answer all the questions you have.