How to fix User Online @ website?
that 1 :/Quote:
<?php
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
odbc_exec($mssql, 'USE [LOGGING_01_DBF]');
$peak = odbc_exec($mssql, 'SELECT TOP 1 number FROM [LOG_USER_CNT_TBL] ORDER BY [number] DESC');
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
$accounts = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL]');
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$character = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL]');
$guilds = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [GUILD_TBL]');
odbc_exec($mssql, 'USE [LOGGING_01_DBF]');
$peak = odbc_exec($mssql, 'SELECT TOP 1 number FROM [LOG_USER_CNT_TBL] ORDER BY [number] DESC');
?>
<h1>Server Information</h1>
<div class="panel">
<table>
<tr>
<td>Server Time:</td>
<td id="srvtime"></td>
</tr>
<tr>
<td>Server Date:</td>
<td><?php echo date('d.m.Y'); ?></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>Server Status:</td>
<td><div id="srvworld"><img src="./img/load.gif" alt="" /></div></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<br><tr><td>Accounts:</td><td><?php echo odbc_result($accounts, 'count'); ?></td></tr>
<tr><td>Character:</td><td><?php echo odbc_result($character, 'count'); ?></td></tr>
<tr><td>Guild:</td><td><?php echo odbc_result($guilds, 'count'); ?></td></tr>
<tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<td>Server Peak:</td>
<td><?php echo odbc_result($peak, 'number'); ?></td>
</tr>
<tr>
<td>Online User:</td>
<td><?php echo odbc_result($online, 'count'); ?></td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>EXP Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td>Drop Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td>Penya Rate:</td>
<td>3000x</td>
</tr>
<tr>
<td colspan="2"><br /></td>
</tr>
<tr>
<td>Teamspeak IP:</td>
<td>12.34.567.89</td>
</tr>
<tr>
<td>Teamspeak Port:</td>
<td>1234</td>
</tr>
</table>
</div>
Thats only the HTML and PHP script. You have to tell us what you do not like at the script or where the fault lies. So we do not get on... :(Quote:
that 1 :/
He didn't told us that the online user count is not good. He told us how to fix them.Quote:
@iceTea
He already have told that the online user count is not good
Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
#online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0);
It gives me more error sirQuote:
@iceTea
He already have told that the online user count is not good
Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
#online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0);
Did u miss the ' ?Quote:
@iceTea
He already have told that the online user count is not good
Change this line
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [ACCOUNT_TBL] WHERE isuse = \'J\'');
To this
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$online = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE multiServer > 0');
odbc_exec($mssql, 'USE[CHARACTER_01_DBF]'); $online_function = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM[CHARACTER_TBL] WHERE multiServer > 0');
<?php echo odbc_result($online_function, 'count'); ?>
Thanks sir and now it works :)Quote:
So, this function should be work. Credits goes of course to raventh. I have only tested this variable and corrected typographical errors.
But in this code we see the variable $mssql. That means the SQL-Server Connection, it wont work when this function isn't declared. So, when in you use a Stefan Pfeifer Page it should be declared in the config.php.Code:odbc_exec($mssql, 'USE[CHARACTER_01_DBF]'); $online_function = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM[CHARACTER_TBL] WHERE multiServer > 0');
So when you use a Stefan Pfeifer Homepage, is that the right script to output your number X of User Online Count:
If you still have questions, let me know. (via PN)Code:<?php echo odbc_result($online_function, 'count'); ?>
I think the problem is now solved.
I think the problem is solved now.
Therefore I send a #closerquest
Kind Regards,
Icetea'
Done thanks hehe ;)Quote:
Maybe you tell us your error?