sorry but that dont help lol I already use ODBC to connect to the sql but I have no idea how I can get quries to work so I cant make a top players list and etc.
I am completly new with PHP.
edit: I have used way to much time trying to get this to work but atleast I know now that its because mssql doesnt work with my version of PHP
I have to ask though can you please tell me how I make this script work without mssql_functions. I only found a few I could replace. I really hope you can help cos this is making me tear my hair out lol.
PHP Code:
<?php
//here you must to replace data with your
$server = '127.0.0.1';
$dbuser = 'Shaiya';
$dbpass = 'Shaiya123';
$count=1;
$rimg=0;
$cimg=0;
$kdr=0;
$topcount=100;//joker's remake : variable "$topcount" defined rows (1~N) in the table of top(N) players.
//connection with database
$conn = mssql_connect($server, $dbuser, $dbpass) or die("Couldn't connect to SQL Server on $myServer");
$query = "SELECT c.CharID,c.CharName,c.K1,c.K2,c.Job,c.Level,umg.Country FROM PS_GameData.dbo.Chars c INNER JOIN
PS_UserData.dbo.Users_Master um ON c.useruid=um.useruid INNER JOIN
PS_GameData.dbo.UserMaxGrow umg ON umg.UserUID=c.UserUID WHERE
um.status=0 AND c.Del=0 ORDER BY c.k1 DESC";
$result = mssql_query($query);
echo "<html><head><STYLE TYPE=\"text/css\">
<!--
td { background:url(image.png) no-repeat; }
td.i0{ background-position: 0 0; width: 28px; height: 16px; }
td.i1{ background-position: 0 -26px; width: 28px; height: 16px; }
td.i2{ background-position: 0 -52px; width: 28px; height: 16px; }
td.i3{ background-position: 0 -78px; width: 29px; height: 16px; }
td.i4{ background-position: 0 -104px; width: 29px; height: 15px; }
td.i5{ background-position: 0 -129px; width: 28px; height: 18px; }
td.i6{ background-position: 0 -157px; width: 30px; height: 17px; }
td.i7{ background-position: 0 -184px; width: 29px; height: 17px; }
td.i8{ background-position: 0 -211px; width: 28px; height: 16px; }
td.i9{ background-position: 0 -237px; width: 28px; height: 18px; }
td.i10{ background-position: 0 -265px; width: 29px; height: 18px; }
td.i11{ background-position: 0 -293px; width: 29px; height: 24px; }
td.i12{ background-position: 0 -327px; width: 29px; height: 18px; }
td.i13{ background-position: 0 -355px; width: 29px; height: 18px; }
td.i14{ background-position: 0 -383px; width: 29px; height: 18px; }
td.i15{ background-position: 0 -411px; width: 29px; height: 18px; }
td.i16{ background-position: 0 -439px; width: 29px; height: 18px; }
td.i17{ background-position: 0 -467px; width: 24px; height: 24px; }
td.i18{ background-position: 0 -501px; width: 24px; height: 24px; }
td.i19{ background-position: 0 -535px; width: 24px; height: 24px; }
td.i20{ background-position: 0 -569px; width: 24px; height: 24px; }
td.i21{ background-position: 0 -603px; width: 24px; height: 24px; }
td.i22{ background-position: 0 -637px; width: 24px; height: 24px; }
</STYLE>
<title>PvP Rankings</title></head>";
echo "<body><center>
<table cellspacing=10 cellpadding=0 border=0 bgcolor=\"black\">
<td style=\"color:#FC9700\" bgcolor=\"black\">No:</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Name</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Class</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Level</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Kills</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Death</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">KDR</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Rank</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Faction";
while($count != ($topcount+1)) //joker's remake : check the end of table
{
$row = mssql_fetch_array($result);
$cimg = $row[4]+17;
if($row[2] >= 200000)
$rimg=16;
else if($row[2] >= 150000)
$rimg=15;
else if($row[2] >= 130000)
$rimg=14;
else if($row[2] >= 110000)
$rimg=13;
else if($row[2] >= 90000)
$rimg=12;
else if($row[2] >= 70000)
$rimg=11;
else if($row[2] >= 50000)
$rimg=10;
else if($row[2] >= 40000)
$rimg=9;
else if($row[2] >= 30000)
$rimg=8;
else if($row[2] >= 20000)
$rimg=7;
else if($row[2] >= 10000)
$rimg=6;
else if($row[2] >= 5000)
$rimg=5;
else if($row[2] >= 1000)
$rimg=4;
else if($row[2] >= 300)
$rimg=3;
else if($row[2] >= 50)
$rimg=2;
else if($row[2] >= 1)
$rimg=1;
else
$rimg=0;
if($row[6]==0) //joker's remake : check the faction
$faction="AOL";
else
$faction="UOF";
if($row[3]===0)
$kdr=number_format($row[2]/1,3,'.','');
else
$kdr=number_format($row[2]/$row[3],3,'.','');
echo "<tr style=\"color:white\">";
echo "<td>$count</td><td>". $row[1] ."</td><td class=\"i$cimg\"></td><td>". $row[5] ."</td><td>". $row[2] . "</td><td>". $row[3] .
"</td><td>".$kdr."</td><td class=\"i$rimg\"></td><td>$faction</td><td>";
echo "</tr>";
$count++;
}
echo "</table>";
echo "</html>";
mssql_close($conn);
?>