I'm currently trying to refresh my table every 5 seconds, but I'm not being successful.
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Número</th>
<th>Nome do colaborador / secção</th>
</tr>
</thead>
<tbody>
<?php
$req = mysqli_query($con, 'select user_id, user_name from users');
while ($dnn = mysqli_fetch_array($req)) {
echo "<tr>";
echo " <td>" . $dnn['user_id'] . "</td>";
echo " <td>" . $dnn['user_name'] . "</td>";
echo "</tr>";
}
?>
</tbody>
</table>
What I want is to refresh the page every 5 seconds and of course if someone edits he will be able to see the changes that were made.
What can I do to complete this action?