Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server
You last visited: Today at 18:07

  • Please register to post and access all features, it's quick, easy and FREE!

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.

Reply
 
Old   #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
TimeToLove is offline  
Old 03/09/2020, 11:53   #2
 
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
Quote:
Originally Posted by TimeToLove View Post
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
^Nitro^ is offline  
Old 03/09/2020, 16:01   #3
 
elite*gold: 0
Join Date: Mar 2017
Posts: 10
Received Thanks: 0
Quote:
Originally Posted by ^Nitro^ View Post
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.
TimeToLove is offline  
Old 03/09/2020, 16:42   #4
 
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
Quote:
Originally Posted by TimeToLove View Post
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
^Nitro^ is offline  
Old 03/09/2020, 16:43   #5
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,834
Received Thanks: 4,667
Why not helping here? That's what a forum is for
Devsome is offline  
Old 03/10/2020, 14:22   #6
 
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
re

Quote:
Originally Posted by Devsome View Post
Why not helping here? That's what a forum is for
I will
^Nitro^ is offline  
Old 03/10/2020, 14:24   #7
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,834
Received Thanks: 4,667
Quote:
Originally Posted by ^Nitro^ View Post
I will
Here not discord. You told him to write in discord.
Devsome is offline  
Old 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 View Post
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 View Post
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
^Nitro^ is offline  
Thanks
3 Users
Old 03/11/2020, 19:20   #9
 
elite*gold: 0
Join Date: Mar 2017
Posts: 10
Received Thanks: 0
Quote:
Originally Posted by ^Nitro^ View Post
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?
TimeToLove is offline  
Old 03/11/2020, 23:53   #10
 
elite*gold: 0
Join Date: Jun 2019
Posts: 14
Received Thanks: 5
Quote:
Originally Posted by TimeToLove View Post
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.
^Nitro^ is offline  
Reply


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.