How can i add to my website counting player like 8/1000 something like this ,
any help ? thanks
any help ? thanks
If you use old php mssql_connectQuote:
this is in sql.. i need the php .. can you help me on discord or TW or AnyDesk? thanks.
<?php
$sql_host = "YourIP";
$sql_user = "YourUsername";
$sql_pass = "YourPassword";
$sql_db = "SRO_VT_ACCOUNT";
$sqlLink = mssql_connect($sql_host,$sql_user,$sql_pass);
if(!$sqlLink) die("MSSQL server is not accessable, why should we try to select database ?");
else {
mssql_select_db($sql_db,$sqlLink);
}
$query = mssql_query("SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc") or die("Can't connect to database!");
while ($row = mssql_fetch_array($query)) {
echo "
<b>Server: <span style='color:red'><i>YourServerName</i></span> - <span style='color:#fff'>$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b>
";
}
?>
<?PHP
try {
$user = "YourUsername";
$pass = "YourPassword";
$conexao= new PDO("sqlsrv:Server=YourIP,1433;Database=SRO_VT_ACCOUNT", $user, $pass);;
$srdID = 64;
$sql = "SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = ? ORDER BY nID desc";
$stmt = $conexao->prepare($sql);
$stmt->bindValue(1, $srdID);
$stmt->execute();
$linha = $stmt->fetchAll();
$result = array_shift($linha);
$onlineNow = $result['nUserCount'];
echo "
<b>Server: <span style='color:red'><i>YourServerName</i></span> - <span style='color:#fff'>$onlineNow</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b>
";
} catch (Exception $ex) {
echo 'erro: ' . $ex->getCode();
}
?>
yea I done here already take it easy bro don't do a storm inside a glass of water..Quote:
Here not discord. You told him to write in discord.
Quote:
If you use old php mssql_connect
use this:
If You Use New PHP PDOCode:<?php $sql_host = "YourIP"; $sql_user = "YourUsername"; $sql_pass = "YourPassword"; $sql_db = "SRO_VT_ACCOUNT"; $sqlLink = mssql_connect($sql_host,$sql_user,$sql_pass); if(!$sqlLink) die("MSSQL server is not accessable, why should we try to select database ?"); else { mssql_select_db($sql_db,$sqlLink); } $query = mssql_query("SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc") or die("Can't connect to database!"); while ($row = mssql_fetch_array($query)) { echo " <b>Server: <span style='color:red'><i>YourServerName</i></span> - <span style='color:#fff'>$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b> "; } ?>
use this:
Code:<?PHP try { $user = "YourUsername"; $pass = "YourPassword"; $conexao= new PDO("sqlsrv:Server=YourIP,1433;Database=SRO_VT_ACCOUNT", $user, $pass);; $srdID = 64; $sql = "SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = ? ORDER BY nID desc"; $stmt = $conexao->prepare($sql); $stmt->bindValue(1, $srdID); $stmt->execute(); $linha = $stmt->fetchAll(); $result = array_shift($linha); $onlineNow = $result['nUserCount']; echo " <b>Server: <span style='color:red'><i>YourServerName</i></span> - <span style='color:#fff'>$onlineNow</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b> "; } catch (Exception $ex) { echo 'erro: ' . $ex->getCode(); } ?>
yea I done here already take it easy bro don't do a storm inside a glass of water..
enjoy your life :)