Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $consulta = "SELECT * FROM slider"; // remove LIMIT 1 to select all rows
- $cons = mysqli_query($conect_phpmyadmin,$consulta);
- $i = 0; // set init value as 0
- while ($rs = mysqli_fetch_array($cons)) {
- $id = $rs['id'];
- $imagem = "../uploads/".$rs['desc_img'];
- $active = ($i == 0) ? active : ''; // to set the first slide as active
- ?>
- <div class="item <?= $active; ?>">
- <img src="<?= $imagem; ?>">
- <div class="carousel-caption">
- <div class="btn-group" role="group">
- <button type="button" class="btn btn-info"><h5>Replace this with your column value</h5></button>
- </div>
- </div>
- </div>
- <?php
- $i++; // $i value will be incremental by 1
- } ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement