Hey all.. sorry if the topic title looks misleading.. perhaps I'm not completely sure how to formulate this question properly ;p I'm new to arrays you see so I may of done this a bit weirdly.. but it does work.. without the sorting part. Here's my code [code] <table style="font-family:Verdana,Arial;font-size:10px;color:black;" width="570px"> <tr align="center"> <td><b style="color:white;">Ligue</td> <td><b style="color:white;">Nombre d'équipes</td> <td><b style="color:white;">Moyenne des cotes</td> </tr> <? $regionsRS = $db->execute("SELECT DISTINCT RegionID FROM equipes WHERE ClassID=".$ClassID); $y = $regionsRS->getNumOfRows(); $filterStr="0"; for ($j=0;$j<$y;$j++){ $filterStr=$filterStr.",".$regionsRS->fields["RegionID"]; $regionsRS->nextRow(); } $requete="SELECT * FROM tblRegions WHERE ID IN (".$filterStr.") ORDER BY Name"; $regionsRS = $db->execute($requete); $y = $regionsRS->getNumOfRows(); for ($j=0;$j<$y;$j++){ $requete="SELECT Count(ID) as nbTeams, sum(cote) as totalCote FROM equipes WHERE RegionID = ".$regionsRS->fields["ID"]." AND ClassID=".$ClassID; $countRS = $db->execute($requete); $moyLig_array[$j][0]=$regionsRS->fields["Name"]; $moyLig_array[$j][1]=$countRS->fields["nbTeams"]; $moyLig_array[$j][2]=round($countRS->fields["totalCote"]/$countRS->fields["nbTeams"],1); $regionsRS->nextRow(); } // end for sort($moyLig_array); for ($j=0;$j<$y;$j++){ if ($bgColor!="#efefef"){ $bgColor="#efefef"; }else{ $bgColor="#ffffff"; } ?> <tr align="center" style="cursor:hand;" onClick="location.href='categories.php?ClassID=<? echo $ClassID;?>&RegionID=<? echo $regionsRS->fields["ID"];?>';"> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][0]; ?></td> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][1]; ?></td> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][2]; ?></td> </tr> <? $regionsRS->nextRow(); } // end for ?> </table> [/code] Basically.. I made what I'm going to call an array.. although it's really more like a table.. Each row is divided into 3 columns. The 3rd column contains a float value. And I'd like to sort my table/array on that float value before I echo it out in my table. Could anyone be so kind as to show me how to do this please? Thanks much!