SELECT first_name, note, @curRank := @curRank + 1 AS rank FROM person p, (SELECT @curRank := 0) r ORDER BY note;
<?php //RECHERCHE MOYENNE MAXIMALE $requeteEXPmax = "select max(moyennenote) from note_php where anneescolairenote='$anneescolaire' and matierenote='Expression-Orale' and classenote='$nomcla' and trimestre='$trimestre'"; $resultatEXPmax = mysql_query($requeteEXPmax) or die(mysql_error()); $rowEXP1er=mysql_fetch_array($resultatEXPmax); $RangEXP1er=$rowEXP1er[0]; //RECHERCHE NBRE DE MOYENNE SUP ET EGALE A LA NOTE $requeteEXPrg = "select count(moyennenote) from note_php where anneescolairenote='$anneescolaire' and moyennenote>'$rowEXP[0]' and moyennenote<='$RangEXP1er' and matierenote='Expression-Orale' and classenote='$nomcla' and trimestre='$trimestre'"; $resultatEXPrg = mysql_query($requeteEXPrg) or die(mysql_error()); $rowEXPrg=mysql_fetch_array($resultatEXPrg); $RangEXP=$rowEXPrg[0]; if($rowEXP[0]==$RangEXP1er) echo "1" ; else echo $RangEXP+1 ; ////RECHERCHE NBRE DE MOYENNE EGALE A NOTE $requeteEXPex = "select count(moyennenote) from note_php where anneescolairenote='$anneescolaire' and moyennenote='$rowEXP[0]' and matierenote='Expression-Orale' and classenote='$nomcla' and trimestre='$trimestre'"; $resultatEXPex = mysql_query($requeteEXPex) or die(mysql_error()); $rowEXPrgex=mysql_fetch_array($resultatEXPex); $RangEXPex=$rowEXPrgex[0]; if($RangEXPex>1) echo"ex" ; else echo"e" ; ?>