Basically trying to retrieve a username to display from a table in SQL. But it doesn't display anything. Just blank.
$sql = "SELECT Username FROM Persons WHERE PlayerID='".$_SESSION['ID']."'";
$result = mysqli_query($mysqli, $sql);
$row = mysqli_fetch_assoc($result);
$username = $row['Username'];
Connection to DB is fine. Table is called Persons, Has headings Username, Password, Player ID
To display it I use:
<?php echo $username; ?>