If I understand you right, then maybe a query like:
SELECT candidate FROM tablename WHERE team='$team'
Would pull a list/array of all candidates from a given team.
If I understand you wrong, then it might help if you could post your table schema.