I am having this weird problem. There are seven admins: darth, jane, luke, najin, root, sam and sydney.
CODE:
<table>
<tr>
<th style="text-align: left; width: 200px;">Username</th>
<th colspan="2" style="text-align: left;">Action</th>
</tr>
<?php
$sql = "SELECT * FROM admins ORDER BY Admin_Username ASC";
$result = mysqli_query($connection, $sql);
$admin = mysqli_fetch_assoc($result);
while($admin = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo ($admin["Admin_Username"]); ?></td>
<td><a href="edit_admin.php?id=<?php echo urlencode($admin["id"]); ?>">Edit</a></td>
<td><a href="delete_admin.php?id=<?php echo urlencode($admin["id"]); ?>" onclick="return confirm('Are you sure you want to delete this admin?');">Delete</a></td>
</tr>
<?php
}
?>
</table>
If I use ASC order, the first admin, darth is not displayed in the loop and if I use DESC order, the last admin, sydney doesn't show up.
What could be the problem here?