Well, I have a problem, I know how to pull the ranking and everything.
My doubt is that I'm going to pull the 6 with the highest score, and I wanted the top 3 to have a different background, like:
Whats the first thing: yellow;
O second: blue;
Third-place: red;
The rest: gray;
How can I do this?
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 } ?>