4
Well, I have a problem, I know how to pull the ranking and all.
My question is I’m gonna pull the 6 with the highest score, and I wanted the first 3 to have a different background, like:
Whatever comes first: yellow;
The second place: blue;
The third place: red;
The rest: gray;
How can I do that?
Code:
<?php
$rank = mysql_query("SELECT * FROM forum ORDER BY pontos DESC LIMIT 6") or die(mysql_error()); ?>
<?php $i = 0; while($row = mysql_fetch_assoc($rank)){ $i++; ?>
<div style="background: gray;width: 60px;height: 20px;padding: 20px;">
<?php echo $row['username']; ?> com <?php echo $row['pontos']; ?>
</div>
<?php } ?>
It would be a ranking of what exactly, @Kloves?
– Ulysses Alves
Users with more posts.
– Paulo Cavalcante