Your second query has an SQL syntax error:
$sql = "SELECT * FROM `apps` WHERE `MCName` = ". $username;
The $username
variable needs to be wrapped in quotes. Try updating to the following to fix:
$sql = "SELECT * FROM `apps` WHERE `MCName` = '". $username . "'";