I need to display the elearning progress of each user. This value is retrieved from the database using PHP. The progress bar i'm using is with bootstrap and it requires that I put the progress value inside the width property found in the inline css. Is this possible? This is what I've tried but it's not displaying anything:
CODES
<?php
include('../../dbconnect.php');
$id = $_SESSION['ID'];
$sql = "SELECT * FROM progress WHERE lectureID=1 AND chapterID = 1 AND currentLevel='novice' AND ID = '$id';";
$query = mysqli_query($con, $sql) or die('Query failed');
while ($result = mysqli_fetch_array($query)) {
$value = $result['chapterPerc'];
?>
<div class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo $value ?> %;"> <!--tried this-->
</div>
<?php
} //while loop closes here
?>
</div>
Any help will be appreciated thanks.
$valueis what you expect? What does the source output look like? Might just be the space before the%?<?php echo $value ?>and%in the inline CSS.<?= $value ?>... Keeps things neater I find. Just an observation.