• 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 [GESIOR2012] Bans Page and Powerfull guilds stop working

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,425
Solutions
17
Reaction score
166
Location
Brazil
Hi guys, everything ok?

My @Gesior.pl AAC page seems to be ok until yesterday, today some strange thing happens: my "Bans" page stopped working and "Most Powerfull Guilds" stopped working on Lastest News Page. My only changes are in my.cnf files to optimze, nothing on database.

I've got this error on log file when i try to open ban page:

[Mon Dec 19 20:04:39.560340 2022] [php7:error] [pid 4453] [client 189.5.181.179:14658] PHP Fatal error: Uncaught Error: Call to a member function fetchAll() on boolean in /var/www/html/pages/bans.php:4\nStack trace:\n#0 /var/www/html/system/load.page.php(7): include()\n#1 /var/www/html/index.php(39): include_once('/var/www/html/s...')\n#2 {main}\n thrown in /var/www/html/pages/bans.php on line 4, referer: Latestnews - ExtremeOT (https://extremeot.com.br/)

[Mon Dec 19 20:05:56.199688 2022] [php7:error] [pid 4457] [client 189.5.181.179:25272] PHP Fatal error: Uncaught Error: Call to a member function fetchAll() on boolean in /var/www/html/pages/bans.php:4\nStack trace:\n#0 /var/www/html/system/load.page.php(7): include()\n#1 /var/www/html/index.php(39): include_once('/var/www/html/s...')\n#2 {main}\n thrown in /var/www/html/pages/bans.php on line 4, referer: Powergamers - ExtremeOT (https://extremeot.com.br/?subtopic=powergamers&type=sum)

[Mon Dec 19 20:09:56.731724 2022] [php7:error] [pid 4448] [client 189.5.181.179:40910] PHP Fatal error: Uncaught Error: Call to a member function fetchAll() on boolean in /var/www/html/pages/bans.php:4\nStack trace:\n#0 /var/www/html/system/load.page.php(7): include()\n#1 /var/www/html/index.php(39): include_once('/var/www/html/s...')\n#2 {main}\n thrown in /var/www/html/pages/bans.php on line 4, referer: Latestnews - ExtremeOT (https://extremeot.com.br/?subtopic=latestnews)


PHP:
<?PHP
$ban_types = array(1 => 'IP Banishment', 2 => 'Namelock', 3 => 'Account Banishment', 4 => 'Notation', 5 => 'Until Deletion');
$ban_reason = array("Unknown Reason", "Offensive Name", "Invalid Name Format", "Unsuitable Name", "Name Inciting Rule Violation", "Offensive Statement", "Spamming", "Illegal Advertising", "Off-Topic Public Statement", "Non-English Public Statement", "Inciting Rule Violation", "Bug Abuse", "Game Weakness Abuse", "Using Unofficial Software to Play", "Hacking", "Multi-Clienting", "Account Trading or Sharing", "Threatening Gamemaster", "Pretending to Have Influence on Rule Enforcer", "False Report to Gamemaster", "Destructive Behaviour", "Excessive Unjustified Player Killing", "Invalid Payment", "Spoiling Auction");
$players_banned = $SQL->query('SELECT `bans`.`type`, `bans`.`value`, `bans`.`comment`,`bans`.`admin_id`, `bans`.`expires`, `bans`.`added`, `bans`.`reason` FROM `bans`, `players` WHERE `players`.`account_id` = `bans`.`value` AND `bans`.`active` = 1 GROUP BY `bans`.`value` ORDER BY `bans`.`added` DESC')->fetchAll();
if(!$players_banned)
{
    $main_content .= '<center><h2>Wall of shame</h2></center>';
    $main_content .= '<h2><center><b>No one is banned at the moment at '.$config['server']['serverName'].'</b></center></h2>';
}
else
{
    $number_of_players = 0;
    foreach($players_banned as $player)
    {
        $nick = $SQL->query("SELECT name, id, level, account_id FROM `players` WHERE account_id =".$player['value']." ORDER BY level DESC LIMIT 1")->fetch();
        $gmnick = $SQL->query("SELECT name, id FROM `players` WHERE id =".$player['admin_id']."")->fetch();
        if($player['admin_id'] >= "1")
            $banby = "<a href=?subtopic=characters&name=".urlencode($gmnick['name'])."><font color ='green'>".$gmnick['name']."</font></a>";
        else
            $banby = "ExtremeOT System";
        $number_of_players++;
        if(is_int($number_of_players / 2))
            $bgcolor = $config['site']['darkborder'];
        else
            $bgcolor = $config['site']['lightborder'];
        if ($player['expires'] == "-1") // If the banishment is permanent
            $expires = "Permament";
        else
            $expires = date("d/m/Y, G:i:s", $player['expires']);
        $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=15%><A HREF="?subtopic=characters&name='.$nick['name'].'">'.$nick['name'].'</A></TD><TD WIDTH=5%>'.$ban_reason[$player['reason']].'</TD><TD WIDTH=15%>'.$player['comment'].'</TD><TD>'.$banby.'</TD><TD>'.$expires.'</TD></TR>';
    }
    //list of players
    $main_content .= '<center><h2>Wall of shame</h2></center>';
    $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>Banned Player</center></b></TD><TD class="white"><b><center>Reason</center></b></TD><TD class="white"><b><center>Comment</center></b></TD><TD class="white"><b><center>Banned By</center></b></TD><TD class="white"><b><center>Expires</center></b></TD></TR>'.$players_rows.'</TABLE>';
}
?>

PHP:
<?php
if(!defined('INITIALIZED'))
    exit;

ob_start();
$main_content = '';
include("pages/" . $subtopic . ".php");
$main_content .= ob_get_clean();


My Powerfull guilds dont show any error (in web page or log file), or in another place, just dont show guilds. Here's configuration in lastest news

PHP:
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr> ';


foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
`g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
FROM `killers` k
LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0, 4;') as $guild)
$main_content .= '<td style="width: 25%; text-align: center;"><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '"><img src="guild_image.php?id=' . $guild['id'] . '" width="64" height="64" border="0"/><br />' . htmlspecialchars($guild['name']) . '</a><br />' . $guild['frags'] . ' kills
</td>';
$main_content .= '</tr></table>';
Post automatically merged:

I found something, mine MySQL service stop reading changes from
Code:
mysqld.cnf
, so sql_mode got several entries. Anyone has passed by this? How to force Mysql read mysqld.cnf configuration again? I changed permission, dont know if is related.
Post automatically merged:

Yeah, now i found the entire issue, i have changed my.cnf permission folder and file and mysql stopped load from this file, showing me the message:

mysql: [Warning] World-writable config file '/etc/mysql/mysql.conf.d/mysqld.cnf' is ignored.
mysql: [Warning] World-writable config file '/etc/mysql/mysql.conf.d/mysqld_safe_syslog.cnf' is ignored.

So i changed 644 permission in both files and 755 in folder and restart service, back to work like before and both pages are opening now
 
Last edited:
It looks like there is an issue with the PHP code on line 4 of your bans.php file. Specifically, it is trying to call the "fetchAll()"method on a boolean value.
This error is usually thrown when the $SQL->query() function on line 4 returns a boolean value (either true or false instead of a MySQL result object. This can happen if there is an error in the SQL query that is being executed, or if the players table does not exist in the database.
edit
Check the MySQL error log to see if there are any errors related to the SELECT query that is being executed on line 4.
Make sure that the players table exists in the database and that it has the correct structure. I guess this is a good way to go.
 
Last edited:
Back
Top