Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="page-section-server-stats">
- <h2>Top <b>5</b> Highest Scoring Players:</h2>
- <div class="table-responsive">
- <table class="table table-striped table-bordered" style="width:700px;" align="center">
- <tr>
- <th>Rank</th>
- <th>Name</th>
- <th>Score</th>
- </tr>
- <?php
- //First get the last 5.
- $query = mysql_query("SELECT * FROM playerdata ORDER BY score DESC LIMIT 5");
- //Loop through the rows and show each.
- $curRow = 1;
- while ($row = mysql_fetch_array($query, MYSQL_ASSOC))
- {
- //Start printing.
- echo '<tr>';
- echo "<td>#$curRow</td>";
- echo '<td>'
- echo $row['nick'];
- echo '</td>'
- echo '<td>'
- echo $row['score'];
- echo '</td>'
- echo '</tr>'
- $curRow += 1;
- }
- ?>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement