K, I have one issue about PHP. I'm trying to make a highscore for my game that has levels and XP.
My issue is pretty simple, I want to order it by total level, so that the people with the highest total level come up as first, second, third, etc. But I also want it to be ordered by xp, so that if they have the same total level, than the person with the highest xp will be shown first, instead of it being just random.
This is what I have so far for ordering by level, but I don't know how to make it check for the xp.
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM skillsoverall"),0) or die(mysql_error());
$from = (isset($_GET["from"]) && is_numeric($_GET["from"]) && $_GET["from"] < $count) ? $_GET["from"] : 0;
$query = mysql_query ("SELECT * FROM skillsoverall ORDER BY lvl DESC limit $from, $ppls_page") or die(mysql_error());
$i = $from;
while($row = mysql_fetch_array($query)){
$i++;
if($i < $top_hiscore) {
if($i & 1) {
echo '<tr class="row row1">
<td class="rankCol"><span>'.$i.'</span></td>
<td class="nameCol"><span><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></span></td>
<td class="lvlCol">'.dots($row["lvl"]).'</td>
<td class="xpCol">'.dots($row["xp"]).'</td>
</tr>
';
} else {
echo '<tr class="row row2">
<td class="rankCol"><span>'.$i.'</span></td>
<td class="nameCol"><span><a href="'.$website.'/'.$pers.'?name='.$row["playerName"].'" target="_self">'.BBCode($row["playerName"]).'</a></span></td>
<td class="lvlCol">'.dots($row["lvl"]).'</td>
<td class="xpCol">'.dots($row["xp"]).'</td>
</tr>
';