I tried to us IN to call multiple ids.. but the arrangement of ids are not the same..
here's my sample code:
$sample = "1,3,2,4,5";
$sql_top = "SELECT * FROM team_member WHERE pgs_team_member_id IN ($sample)";
You can try order by, like this:
order by field(pgs_team_member_id, $ids);