I am trying to calculate a ranking of a team in an ordered MySQL result set, and the issue I\'m having is detecting ties for the first team to show up with the tied
$exists = array();
if ($row['team_id'] == $team_id && !in_array($row['pts'], $exists)) { //current team in resultset matches team in question, set team's rank
$exists[] = $row['pts'];
$arr_ranks['tp']['cat'] = 'Total Points';
$arr_ranks['tp']['actual'] = number_format($row['pts'],1);
$arr_ranks['tp']['league_rank'] = $rnk;
$arr_ranks['tp']['div_rank'] = $div_rnk;
}