I am unable to make $firstname equal to $row['Firstname']. The same with Lastname too.
$locationsQuery='select Firstname, Lastname, from locations where
username=$username;
$results = sqlsrv_query( $conn, $locationsQuery, array($desiredusername));
while($row = sqlsrv_fetch_array($results))
{
$firstname = $row['Firstname'];
$lastname = $row['Lastname'];
}