Создаем базу в mssqlе
Код:
CREATE TABLE [uWebplayers] ( [roleid] [int] NOT NULL , [rolename] [varchar] (50) COLLATE Latin1_General_CI_AS NULL , [rolelevel] [int] NULL , [rolestatus] [int] NULL , [rolegender] [int] NULL , [roleprof] [int] NULL , [rolerep] [bigint] NULL , [redname] [bigint] NULL , [rednametime] [bigint] NULL , [pinknametime] [bigint] NULL , CONSTRAINT [PK_uWebplayers] PRIMARY KEY CLUSTERED ( [roleid] DESC ) ON [PRIMARY] ) ON [PRIMARY] GO
Скрипт вывода топ игроков в PHP:
Код:
<?php //-------------DATABASE SESSION-----------------------// $sql_server = "10.1.1.1"; //<-- MSSQL server address/ip $sql_user = "sa"; //<-- MSSQL username $sql_pass = "test"; //<-- MSSQL password $sql_data = "passport"; //<-- MSSQL database $conn=mssql_connect($sql_server,$sql_user,$sql_pass); $xadb = mssql_select_db($sql_data,$conn) or die("$uwebmsg_cerr"); $uweb_toplvlq = "SELECT * FROM uWebplayers ORDER BY rolelevel DESC"; $uweb_toplvlr = mssql_query($uweb_toplvlq); $uweb_toplvl_num = 0; echo "<p><b>TOP PLAYERS<b></p><p>"; echo "<Table width=100% border=1><TR><TD><B>RANK NUMBER</B></td><TD><B>PLAYER NAME</B></td><TD><B>PLAYER LEVEL</B></td></tr>"; while ($uweb_toplvlrow = mssql_fetch_array($uweb_toplvlr)) { $uweb_toplvl_num++; echo "<TR><TD>$uweb_toplvl_num</td><TD>".$uweb_toplvlrow[rolename]."</td><TD>".$uweb_toplvlrow[rolelevel]."</td>"; if ($uweb_toplvl_num >= 500) break; } echo "</table></p>"; ?>