MSSQL alternative for PHP 5.3

I am new with PHP but I am running an online multiplayer game server.

my problem is that PHP 5.3 dont really support mssql and therefore I need other functions instead. I know I need to use OBDC or SQLSRV instead but I really hate to say I dont know much about it and the thing I tried only complicated things more so this is my last try to get it to fixed. Really hope you can help.

this script is suposed to show the top online players. what I want to know is what I can use isntead of the Mssql functions.

[php]<?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 "<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; } PvP Rankings"; echo " "; echo ""; $count++; } echo "
No: Name Class Level Kills Death KDR Rank 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 "
$count ". $row[1] ." ". $row[5] ." ". $row[2] . " ". $row[3] . " ".$kdr." $faction "; echo "
"; echo ""; mssql_close($conn); ?> [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service