<?
include('config.php');
$query = "SELECT TOP 5 Name,cLevel,Reset from Character order by Reset desc , cLevel desc ";
$result = mssql_query($query);
echo '<TABLE border=0 cellPadding=0 cellSpacing=0 >
<TBODY>
<TR>
<TD align=left vAlign=top><A
</TR>
<TR>
<TD align=left
vAlign=top>
<TABLE border=0 cellPadding=10 cellSpacing=0
<TBODY>
<TR>
<TD align=middle vAlign=center>
<table height=30 cellspacing=0 cellpadding=0
width=155 border=0 >
<tbody
<tr>
<td valign=top align=left width=0 height=0><span class="style50">#</td>
<td valign=top align=left width=0><span class="style50">Name</td>
<td valign=top align=center width=0><span class="style50">Level</td>
<td valign=top align=right width=0><span class="style50">Resets</td>
</tr>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$rank = $i+1;
echo "<tr><td valign=top align=left><span class='style50'>$rank.</td>
<td valign=top align=left><span class='style50'>$row[0]</td>
<td valign=top align=center><span class='style50'>$row[1]</td>
<td valign=top align=center><span class='style50'>$row[2]</td>
</tr>";
}
?>
</tbody>
</table>
</TD>
</TR></TBODY></TABLE></TD></TR>
<TR>
</TD></TR></TBODY></TABLE>