Register for your free account! | Forgot your password?

You last visited: Today at 01:47

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

Advertisement



[PHP] Online User Total

Discussion on [PHP] Online User Total within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2011
Posts: 303
Received Thanks: 44
[PHP] Online User Total

Im trying to set a php page to display online user total i have the following code:

PHP Code:
<?php
@$connect odbc_connect("Driver={SQL Server};Server={".$host."}; Database={".$db2."}""".$user."""".$pass."") or die("<center><b style=\"border:1px dashed #FF0000;\">".str_replace("[Microsoft][ODBC SQL Server Driver][SQL Server]"""odbc_errormsg())."</b></center>");
@
odbc_result_all(odbc_exec($connect"SELECT TOP (".$show2.") nUserCount as Online FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID DESC"));
echo 
"
                    <b>Server: <span style='color:red'><i>Sro </i></span> - <span style='color:#000'>
$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#000'>1000</span> <span style='color:green'>are currently online!</span></b>    
                    "
;
        
?>
This code shows a box with total number of user's but im trying to get it to spit out the total where $row[nUserCount] is can anyone point me in the right direction or any script already out there with odbc connection >?

Serenduk is offline  
Old 03/20/2012, 15:10   #2
 
elite*gold: 0
Join Date: Nov 2011
Posts: 303
Received Thanks: 44
any help please ?
Serenduk is offline  
Old 03/20/2012, 15:45   #3
 
elite*gold: 0
Join Date: Sep 2011
Posts: 14
Received Thanks: 1
PHP Code:
<?php 
$host 
"host"//Host
$db2 "SRO_VT_ACCOUNT"//DB
$user "username"//username
$pass "pw";  //pw
$show2 1
@
$connect odbc_connect("Driver={SQL Server};Server={".$host."}; Database={".$db2."}""".$user."""".$pass."") or die("<center><b style=\"border:1px dashed #FF0000;\">".str_replace("[Microsoft][ODBC SQL Server Driver][SQL Server]"""odbc_errormsg())."</b></center>"); 
@
odbc_result_all(odbc_exec($connect"SELECT TOP (".$show2.") nUserCount as Online FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID DESC")); 
echo 

                    <b>Server: <span style='color:red'><i>Sro </i></span> - <span style='color:#000'>
$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#000'>1000</span> <span style='color:green'>are currently online!</span></b>     
                    "

         
?>
silkroadnet is offline  
Old 03/20/2012, 21:10   #4
 
elite*gold: 0
Join Date: Nov 2011
Posts: 303
Received Thanks: 44
thats just adding the db connect info im already connecting but as i put it displays stats in a block not in the area required if u test and look
Serenduk is offline  
Reply


Similar Threads Similar Threads
[Small Release]5369 Total Players Online
07/07/2011 - CO2 PServer Guides & Releases - 24 Replies
connect.php <?php $error = "<body bgcolor='black'><font color='white'>Problem connecting to database, Please try again later.</font>"; $connect = mysql_connect("localhost", "root", "MYSQLPASSWORD") or die($error); mysql_select_db("lol") or die($error); ?>
[HELP]Server Status Total acc/char players online code
02/13/2010 - CO2 Private Server - 7 Replies
HELP I need a Server Status, Total account, Total Character and Total Players Online code for 5165 using appserver NON-HAMACHI HELP!
[Release] Total Players Online
09/09/2009 - CO2 PServer Guides & Releases - 1 Replies
For Who Looking For that code that code let you know how many players play on your server now Its Not Made by Me Total Players Online: 30 Just Put it On Register.php
Total Player Online
08/30/2009 - CO2 Private Server - 23 Replies
Im using Binary 5065 i want to add in my reg page Code to know how many players online on server like this Total Accounts: 357 Total Characters: 281 Total Player Online: <---- i want to add this Server Status: Online



All times are GMT +1. The time now is 01:47.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.