I'm trying to set up a menu list which pulls an array from a mysql query and uses a foreach to echo out each list element.
I'm using font awesome, and for some reason when I place the <i>
elements inside of an echo line, the icons do not render. Other icons on the same page are rendering just fine.
I've verified that all of the CSS
files are being included properly.
Here is the block of code, you can see that I am generating some icon names using str_replace()
, however there are other icons in the echo that are static.
I'm pulling my hair out here.
$result = mysqli_query($con,"SELECT * FROM outageupdates ORDER BY timestamp");
while($row = mysqli_fetch_array($result))
{
$time = strtotime($row[timestamp]);
$time = date("H:i", $time);
$icon = str_replace("Internal", "fa-user", $row[type]);
$icon = str_replace("External", "fa-user-times", $row[type]);
echo '<li><a href="outageupdates.php"><i class="fa ' . $icon . '"></i>' . $row[agentname] . ' - ' . $row[type] . '<small class="pull-right"><i class="fa fa-clock"></i>' . $time . '</small></a></li>';
}