Rozumiem, że chodzi Ci o to, że ktoś w ?id=31 zamiast 31 może podać zapytanie SQL.
Rozwiązaniem może być: *LINK*
A jeżeli chodzi o wyświetlenie tabeli:
<table class="table table-striped">
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<?php
$db = new mysqli("", "", "", "");
foreach($db->query("SELECT...") as $r): ?>
<tr>
<td><a href="usun.php?id=<?= $r['id'] ?>">usun</a><td>
</tr>
<?php endforeach;
?>
</tbody>
</table>