I have
foreach(range(1,$row['group1_receptacles'] + $row['group2_receptacles'] + $row['group3_receptacles']) as $x)
{
echo "<li>";
echo '<div class="alert alert-primary border border-primary" role="alert">';
echo '<nav aria-label="breadcrumb">';
echo '<ol class="breadcrumb justify-content-center m-0">';
foreach($power_trails AS $power_trail) {
if($power_strip_id == $power_trail['power_strip_id']) {
echo '<li class="breadcrumb-item">';
echo '<a href="../power_strips/show_power_strip.php?id='.$power_trail['power_strip_id'].'">';
echo '<img src="../../images/power_strip_icon.png" alt="Power" width="30">';
echo '</a>';
echo '</li>';
}
}
echo '</ol>';
echo '</nav>';
echo '</div>';
echo "</li>";
}
the result…
The fijrst foreach loops 10 times (tfhags right)
But I have 3 power trails with a power_strip_id of 4,
so why is the picture showing up in all and not 4?