PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$query = mysql_query("SELECT *
FROM teams");
while ($res = mysql_fetch_array($query)) {
$team[$i] = $res['team'];
$score[$i] = $res['score'];
$i++;
}
I want to sort them descendingly so the team with the highest score is array key 0 and the rest of the values descend but once I do this the scores no longer match the teams they correspond to. How am I able to get around this problem?