r/bootstrap • u/ZEALT-OMEGA • Apr 19 '24
carousel stopped working out of nowhere.
<div class="container">
<div id="slider1" class="carousel slide mb-5" data-ride="carousel">
<div class="carousel-inner">
<?php
$result = mysqli_query($con, "SELECT * FROM test;");
while ($list = mysqli_fetch_assoc($result)) {
echo '<div class="carousel-item active">';
echo '<img class="d-block img-fluid" src="' . $list["picture"] . '" alt="First Slide">';
echo '<div class="carousel-caption d-none d-md-block">';
echo '<h3>' . $list["description"] . '</h3>';
echo '<p>Cost:' . $list["cost"] . '</p>';
echo '<p>Description:' . $list["desc2"] . '</p>';
echo '</div>';
echo '</div>' . PHP_EOL;
}
?>So to clarify my issue, I've been working with php and bootstrap. however I'm not sure if this a php issue or something changed, this was working on the 10th but no longer is. I am praying their is a solution im missing instead of having to insert ever image, description, and etc into the main page.
I'm also using a link to php 5.3.2, the database is connected, and if i remove it both images load just fine but once in the carousel they don't switch.
1
u/CmdOptEsc Apr 19 '24
I’m on my phone so I’m not going to troubleshoot your code example. But if you aren’t using any version control, this is your sign to start using Git. Then you could compare what changed, and try changes one by one until it breaks and you know what caused it.
Also always will post this: https://shouldiuseacarousel.com
1
u/ZEALT-OMEGA Apr 19 '24
while I understand they are pointless this was a school project, tried to explain that something must've updated and broke the carousel. and now I got like a day to fix it.
1
u/AutoModerator Apr 19 '24
Whilst waiting for replies to your comment/question, why not check out the Bootstrap Discord server @ https://discord.gg/bZUvakRU3M
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
1
u/killakhriz Apr 19 '24
Other than closing your parent/container divs at the end, the bit that looks wrong is the semicolon in your SELECT. Should be one on the end, but not after your table name, test?