You should be using prepared statements rather than string interpolation or concatenation.
This is wasted. You are overwriting the value, so only grab the first value or only select a single value, this shouldn’t be a loop. You are also assigning a local variable $country the value of the session, which it doesn’t look like you set anywhere? Should that be:
$_SESSION['country'] = $country;
This is more wasted space. You don’t need to assign variables to variables to variables. Just use the container the value is in. Meaning if $row[‘id’] has the value, there is no point in creating another variable to hold that value.