title: How can i fill up a bootstrap carousel with images from database?
body: <p>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.</p>
  <pre><code>&lt;?php
  $stmt = $pdo-&gt;prepare(&quot;SELECT * FROM images&quot;);
                     
                             $stmt-&gt;execute();
                             $image = $stmt-&gt;fetchAll();
  ?&gt;
  
  &lt;?php foreach($image as $images) 
     {
  ?&gt;
                       
    &lt;div class=&quot;carousel-inner&quot;&gt;
      &lt;div class=&quot;carousel-item active&quot;&gt;
        &lt;img class=&quot;d-block w-100&quot; src=&quot;/upload/&lt;?php echo $images['image']?&gt;&quot; alt=&quot;First slide&quot;&gt;
      &lt;/div&gt;
   
  &lt;div class=&quot;carousel-item&quot;&gt;
  &lt;?php 
  }
  
   ?&gt; 
   &lt;/div&gt; 
  
  
  
  &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    
    &lt;a class=&quot;carousel-control-prev&quot; href=&quot;#carouselExampleIndicators&quot; role=&quot;button&quot; data-slide=&quot;prev&quot;&gt;
      &lt;span class=&quot;carousel-control-prev-icon&quot; aria-hidden=&quot;false&quot;&gt;&lt;/span&gt;
      &lt;span class=&quot;sr-only&quot;&gt;Previous&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class=&quot;carousel-control-next&quot; href=&quot;#carouselExampleIndicators&quot; role=&quot;button&quot; data-slide=&quot;next&quot;&gt;
      &lt;span class=&quot;carousel-control-next-icon&quot; aria-hidden=&quot;false&quot;&gt;&lt;/span&gt;
      &lt;span class=&quot;sr-only&quot;&gt;Next&lt;/span&gt;
    &lt;/a&gt;
    
  </code></pre>