• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC GEISOR AAC Online.php bug

T

Tinkz

Guest
I´m getting an error on my geisor aac, this might explain
010bd11eeba5bea494310bc90b9c352e.png


When i reload the website it works fine but after 1 - 2 seconds it returns to that error again.


online.php
PHP:
<?php
include("config/config.php");

//connection to the database
$dbhandle = mysql_connect($config['site']['sqlHost'], $config['site']['sqlUser'], $config['site']['sqlPass'])
or die("ERROR #CONN");

//select a database to work with
$selected = mysql_select_db($config['site']['sqlDatabase'],$dbhandle)
  or die("ERROR #DB");

//execute the SQL query and return records
$result = mysql_query("SELECT * FROM players, players_online WHERE players.id = players_online.player_id");
$num_rows = mysql_num_rows($result);

echo '<font color="lime" class="View">'.$num_rows.'</font> <font color="orange">/</font> <font color="red">1000</font>';

//close the connection
mysql_close($dbhandle);
?>
 
Last edited by a moderator:
Solution
T
I removed the entire online.php and it fixed it. I guess geisor has already something that gets the information
SQL host, user, pass is in SERVER config, not SITE config, so it would be:
Code:
$config['server']['sqlHost']
but you cannot use it this way, because you need to load Gesior acc. maker to get access to that variable.

If you want get number of players online from database in layout or in any page (file in folder '/pages') you can use:
Code:
$num_rows = $SQL->query('SELECT COUNT(1) AS players_online_count FROM players_online')->fetch()['players_online_count'];
 
SQL host, user, pass is in SERVER config, not SITE config, so it would be:
Code:
$config['server']['sqlHost']
but you cannot use it this way, because you need to load Gesior acc. maker to get access to that variable.

If you want get number of players online from database in layout or in any page (file in folder '/pages') you can use:
Code:
$num_rows = $SQL->query('SELECT COUNT(1) AS players_online_count FROM players_online')->fetch()['players_online_count'];

This is what happends, it works fine the first 2 - 3 seconds.
ac4b063de522abd6122f8a2c9f443e9f.gif
 
Why are you opening a new database connection using mysql_ when gesior already opens for you a connection? :confused:

You should use what gesior told you. Use the gesior connection
 
Back
Top