<table width=550>
<tr>
<td align=center>ID</td>
<td align=center>Name</td>
<td align=center>Resets</td>
<td align=center>Levels</td>
</tr>
<?php
$query = mssql_query("Select Top 20 Name,cLevel,Reset from Character order by Reset desc, cLevel desc");
for($i=0;$i < mssql_num_rows($query);++$i)
{
$row = mssql_fetch_row($query);
$rank = $i+1;
echo"
<tr>
<td align=center>$rank</td>
<td align=center>$row[0]</td>
<td align=center>$row[2]</td>
<td align=center>$row[1]</td>
</tr>
";
}
?>
</table>