I have the following code:
while($row12 = mysql_fetch_array($result12)) {
$position = $row12['position'];
$tot[$k] = $row12['total'];
$k++;
}
$arr = arsort($tot);
for($x = 0; $x < $k; $x++) {
echo $tot[$x]."<br>";
}
I have been able to create the array of the totals from the database records but need to sort the values in descending order.
For example, before sorting:
- 107
- 563
- 109
- 246
- 897
and after sorting:
- 897
- 563
- 246
- 109
- 107