Vaske Posted November 16, 2021 Share Posted November 16, 2021 So I'm working on a project and want my carousel to present most recently added 3 images and each of those images needs to lead to its own page how would I possibly achieve this, I tried multiple times but I keep running into problems some of them I manage to figure out but at the end its always the same result of not working. Any help is much appreciated! Here is the carousel: <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block w-100" src="amin/thumb/<?php $row['imgpath']; ?>" alt="First slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="..." alt="Second slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="..." alt="Third slide"> </div> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></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="true"></span> <span class="sr-only">Next</span> </a> </div> Quote Link to comment https://forums.phpfreaks.com/topic/314239-carousel-with-database/ Share on other sites More sharing options...
ginerjm Posted November 16, 2021 Share Posted November 16, 2021 What is wrong? Do you have an error to report? Quote Link to comment https://forums.phpfreaks.com/topic/314239-carousel-with-database/#findComment-1592170 Share on other sites More sharing options...
Vaske Posted November 16, 2021 Author Share Posted November 16, 2021 6 minutes ago, ginerjm said: What is wrong? Do you have an error to report? No error report, just the image doesn't show up. Quote Link to comment https://forums.phpfreaks.com/topic/314239-carousel-with-database/#findComment-1592171 Share on other sites More sharing options...
ginerjm Posted November 16, 2021 Share Posted November 16, 2021 (edited) Which image? Have you looked at your web page to see how the img tag looks? Edited November 16, 2021 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/314239-carousel-with-database/#findComment-1592173 Share on other sites More sharing options...
Barand Posted November 17, 2021 Share Posted November 17, 2021 16 hours ago, Vaske said: <img class="d-block w-100" src="amin/thumb/<?php $row['imgpath']; ?>" alt="First slide"> That line is wrong. It should be either <img class="d-block w-100" src="amin/thumb/<?php echo $row['imgpath']; ?>" alt="First slide"> // or <img class="d-block w-100" src="amin/thumb/<?= $row['imgpath']; ?>" alt="First slide"> Quote Link to comment https://forums.phpfreaks.com/topic/314239-carousel-with-database/#findComment-1592181 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.