Hi,
I got a new template Forsaken_Flynn. I have problem getting online players from database. Using MuCore 1.0.8(Image : Screenshot by Lightshot)
Thanks
Hi,
I got a new template Forsaken_Flynn. I have problem getting online players from database. Using MuCore 1.0.8(Image : Screenshot by Lightshot)
Thanks
website use odbc or mssql ?
lol :D
search in config.ini
/*-------------------------------------*\
| MUCore SQL Connection Type: |
| |
| MSSQL : Connect using mssql_conect() |
| ODBC : Connect using odbc |
\*-------------------------------------*/
$core['connection_type'] = "ODBC";
and change to MSSQL
@Tukas
what u mean web is offline? u need to use MSSQL first of all on mucore websites.. odbc is used mostly on older files season or something and not recommended because it doesnt connect to all the database areas.
Fix that, tell us why u have problem with mssql what errors u get etc and we will help ya.
OK so now the MuCore is on MSSQL. But still I receive same value "0" for Online Users... The rest are OK. Guilds,characters,accounts created. But Online just shows 0. Any other options?
Thanks guys!
I manipulate rather procedural programming method but try this
Procedural("SELECT * FROM MEMB_STAT WHERE ConnectStat = '1' ")
- - - Updated - - -$online = mssql_num_rows(mssql_query("SELECT * FROM MEMB_STAT WHERE ConnectStat = '1' "));
echo $online;
counting rows in the database would rather vote for
And do not forget the condition when the number of rows 0!mssql_num_rows
It could look something like this
if($online < 1) { $online = "0"; }
Last edited by leorond; 21-02-16 at 02:51 PM.
Thanks guys, but it seems to be the same.. It doesn't show users online at all..
Screenshot by Lightshot
Screenshot by Lightshot
Create a file test.php and insert this code
Access to this file over a fixed URL addressPHP Code:<?php
$connect['IP'] = "127.0.0.1"; // server IP
$connect['login'] = "sa"; // server login
$connect['pass'] = "...."; // server password
$connect['database'] = "MuOnline"; // database name
$conn = mssql_connect($connect['IP'], $connect['login'], $connect['pass']) or die("<center>Can't Connect To Database</center>");
$db = mssql_select_db($connect['database'], $conn) or die("<center>Can't Connect To Database</center>");
$online = mssql_num_rows(mssql_query("SELECT * FROM MEMB_STAT WHERE ConnectStat = '1' "));
echo "Online:".$online;
?>
for example
http://domain.tld/test.php
If you do not print the number of online players, the error is elsewhere.