|
You last visited: Today at 18:07
Advertisement
[Request Help] Website counting how many player online
Discussion on [Request Help] Website counting how many player online within the SRO Private Server forum part of the Silkroad Online category.
03/06/2020, 15:52
|
#1
|
elite*gold: 0
Join Date: Mar 2017
Posts: 10
Received Thanks: 0
|
[Request Help] Website counting how many player online
How can i add to my website counting player like 8/1000 something like this ,
any help ? thanks
|
|
|
03/09/2020, 11:53
|
#2
|
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
|
Quote:
Originally Posted by TimeToLove
How can i add to my website counting player like 8/1000 something like this ,
any help ? thanks
|
Code:
use sro_vt_shard
SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc
|
|
|
03/09/2020, 16:01
|
#3
|
elite*gold: 0
Join Date: Mar 2017
Posts: 10
Received Thanks: 0
|
Quote:
Originally Posted by ^Nitro^
Code:
use sro_vt_shard
SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc
|
this is in sql.. i need the php .. can you help me on discord or TW or AnyDesk? thanks.
|
|
|
03/09/2020, 16:42
|
#4
|
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
|
Quote:
Originally Posted by TimeToLove
this is in sql.. i need the php .. can you help me on discord or TW or AnyDesk? thanks.
|
send me im PM your discord I help u
|
|
|
03/09/2020, 16:43
|
#5
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,834
Received Thanks: 4,667
|
Why not helping here? That's what a forum is for
|
|
|
03/10/2020, 14:22
|
#6
|
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
|
re
Quote:
Originally Posted by Devsome
Why not helping here? That's what a forum is for
|
I will
|
|
|
03/10/2020, 14:24
|
#7
|
dotCom
elite*gold: 9842
Join Date: Mar 2009
Posts: 16,834
Received Thanks: 4,667
|
Quote:
Originally Posted by ^Nitro^
I will
|
Here not discord. You told him to write in discord.
|
|
|
03/10/2020, 14:32
|
#8
|
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
|
online users
Quote:
Originally Posted by TimeToLove
this is in sql.. i need the php .. can you help me on discord or TW or AnyDesk? thanks.
|
If you use old php mssql_connect
use this:
Code:
<?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>
";
}
?>
If You Use New PHP PDO
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();
}
?>
Quote:
Originally Posted by Devsome
Here not discord. You told him to write in discord.
|
yea I done here already take it easy bro don't do a storm inside a glass of water..
enjoy your life
|
|
|
03/11/2020, 19:20
|
#9
|
elite*gold: 0
Join Date: Mar 2017
Posts: 10
Received Thanks: 0
|
Quote:
Originally Posted by ^Nitro^
If you use old php mssql_connect
use this:
Code:
<?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>
";
}
?>
If You Use New PHP PDO
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 
|
work like a charm , thanks,
also did you know how to add vote for silks?
|
|
|
03/11/2020, 23:53
|
#10
|
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
|
Quote:
Originally Posted by TimeToLove
work like a charm , thanks,
also did you know how to add vote for silks? 
|
just Google vsro vote for silk
you will get some for sure.
|
|
|
 |
Similar Threads
|
[Request] Vsro counting total acc play time
11/06/2016 - SRO Private Server - 9 Replies
Hi guys,
Like the title above, how can I calculate total online time of an account? I've been searching for a while, but there is no answer for this.
Thanks for help
|
Official Counting Thread for CO2 Main Discussions / Questions
06/13/2008 - Conquer Online 2 - 14 Replies
Bored..... :D:D
......... 1
|
Counting
11/30/2007 - Conquer Online 2 - 1 Replies
My story is that I'm not a really big contributer of the epvpers forums, and I'm doing this because I want to contribute something but I have dial-up connection so I cant really contribute with that.
I took this idea from someone that already did this (cant remember who).
Anyways, the instructions are this, i'll start the thread with the number 1 and each person counts up to the number 999. Its simple.
So lemme start.
1
|
Counting thread
05/04/2007 - Conquer Online 2 - 16 Replies
dont post more than once and if u dont wanna count dont flame plz its just a little fun
since this is a question forum the question is.....how many of us are there?.....
ill start
1
|
All times are GMT +1. The time now is 18:08.
|
|