This is my code:
$sql = "SELECT * FROM notifications";
if($result = mysqli_query($link, $sql)) {
if(mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result)) {
$notification = "
<a class='d-flex align-items-center dropdown-item' href=".$row["link"].">
<div class='dropdown-list-image mr-3'><i class='fas fa-bell'></i>
<div class='bg-success status-indicator'></div>
</div>
<div class='font-weight-bold'>
<div class='text-truncate'><span>".$row["omschrijving"].".</span></div>
<p class='small text-gray-500 mb-0'>".$row["klant"]." - ".$row["createdat"]."</p>
</div>
</a>
";
}
}
}
and further in my page is:
echo "<h6 class='dropdown-header'>Notificaties</h6>
$notification"
I really want to have the output as a single variable for different reasons.
Now it's only outputting the first notification from the database.
Is it possible to do like: echo $notification for each row there is in the table?