Here is a very basic PvP rankings script, be sure to change the server,username and password to match those of your mssql server. Variable limit control how many ranks to display.
PHP Code:
<?php
$server = "localhost";
$user = "Shaiya";
$pass = "Shaiya123";
$count=1;
$limit=25;
$conn = mssql_connect($server, $user, $pass)
or die("Couldn't connect to SQL Server on $server");
$query = "SELECT top $limit* FROM PS_GameData_spec.dbo.chars ORDER BY k1 desc";
$result = mssql_query($query);
echo "<html><head>
<title>PvP Rankings</title></head>
<body><center>
<table><tr>
<td>Rank</td>
<td>Name</td>
<td>Level</td>
<td>Kills</td>
<td>Death</td></tr>";
while($row = mssql_fetch_array($result))
{
echo "<tr>
<td>$count</td>
<td>". $row['CharName'] ."</td>
<td>". $row['Level'] ."</td>
<td>". $row['K1'] . "</td>
<td>". $row['K2'] . "</td>
</tr>";
$count++;
}
echo "</table>";
echo "</html>";
mssql_close($conn);
?>