I'm trying to create a code in php to build a ranking, I was able to make the data appear, the problem is that it's duplicating the results.
$rank = mysql_query("SELECT * FROM user_quizzes ORDER BY pass_score_point DESC") or die(mysql_error());
$i = 0;
while($row = mysql_fetch_assoc($rank)){
$i++;
$rank2 = mysql_query("SELECT * FROM users WHERE not UserName='admin' ORDER BY UserName DESC") or die(mysql_error());
$i2 = 0;
while($row2 = mysql_fetch_assoc($rank2)){
$i2++;
$result = mysql_query('SELECT SUM(pass_score_point) AS pass_score_point FROM user_quizzes' );
$row3 = mysql_fetch_assoc($result);
$sum = $row3['pass_score_point'];
?>
<div class="topo">
<?php echo $row2['UserName']; ?> com <?php echo $row3['pass_score_point']; ?> pontos de acertos!
</div>