Change this:
echo "selected= "selected""
To:
echo 'selected= "selected"'
Because you are trying to echo double quotes inside double quotes PHP thinks it's the end of the string. So, you can change the double quotes to singles.
Also, are you sure you want:
'$team_id'??
That doesn't look right as it's just a string $team_id, not the VALUE of $team_id