im currently making a game server page, i have a badge next to each game server which displays online how could i make it work real time, so it displays when online display
<td><label class="badge badge-success">Online</label></td>
when offline display
<td><label class="badge badge-danger">Offline</label></td>
the query returns back gq_online 1 if the value is 0 how can i make this set the badge 1 online for online badge 0 for offline badge?
<tbody>
<tr scope="row">
</tr>
<tr>
<?php $counter = 1; ?>
<?php foreach ($results as $server) : ?>
<th scope="row"><?php echo $counter++; ?></th>
<td><?php echo $server['gq_address'] ?? 'N/A'; ?></td>
<td><?php echo $server['gq_port_client'] ?? 'N/A'; ?></td>
<td><?php echo $server['gq_hostname'] ?? 'N/A'; ?></td>
<td><?php echo $server['gq_mapname'] ?? 'N/A'; ?></td>
<td><?php echo $server['gq_name'] ?? 'N/A'; ?></td>
<td><?php echo $server['gq_numplayers'] ?? 0; ?></td>
<td><label class="badge badge-success">Online</label></td>
</tr>
<?php endforeach; ?>
</tbody>
im confused with how to if echo for an array that has text and a number at the end