I've searched over the internet but since i'm beginner with php i ve countered some problems. I have a script that orders some gameserver characters by level and points. Ordering by level was easy.
The database is : cDtb
Table name which contains Level
field is Character
.
Now, i would like to use a second query in the same script that will order after Points
field and the table name is called Reward
. I have tried to add as second query like the first one but it's not showing any result.
The end result should sort by decreasing values and using the results from the two tables Character
and Reward
, starting with Points and then Level
Saying ... usernames Test1 and Tes2 got same level 100 but Test1 got 30Points and Test2 35Points which in this case, the rank will be Test2, Test1
Can someone help me on how to add the second query and how it should look like to order both by points and level?
Thanks in advance, below is the script
<tr>
<td><div align="center">Level</div></td>
<td><div align="center">Points</div></td>
</tr>
<tr>
<?
$query=mssql_query("select TOP 15 * from cDtb.dbo.Character order by Level desc");
//---------- second query ??? --------------
while($row=mssql_fetch_assoc($query)){
$levelz=$row['Level'];
$pointz=$row['Points'];
?>
<td style="color: rgb(196, 37, 0); font-weight: bold;">
<div align="center">
<td><?=$levelz;?></td>
<td><?=$pointz;?></td>
</div></td>
</tr>