Sentinel3
New Member
- Joined
- Oct 16, 2014
- Messages
- 180
- Reaction score
- 0
Hi everyone, I got an error when I tryed to set a layout on my site. If someone can tell me what it means...
I leave you the .php file
.php File:
Error that I got in website:
Fatal error: Call to a member function fetchAll() on a non-object in /home/otsmanager/www/public_html/pages/banlist.php on line 4
I leave you the .php file
.php File:
PHP:
<?php
$ban_reason = array("offensive name", "name containing part of sentence", "name with nonsensical letter combination", "invalid name format", "name not describing person", "name of celebrity", "name reffering to country", "Offtopic (Forum)", "name to fake official position", "offensive statement", "spamming", "advertisement not related to game", "macro use", "<center>--></center>", "off-topic public statement", "inciting rule violation", "bug abuse", "game weakness abuse", "Macro Use", "Destructive Behaviour", "<center>--></center>", "multi-clienting", "account trading", "<center>--></center>", "threatening gamemaster", "pretending to have official position", "pretending to have influence on gamemaster", "false report to gamemaster", "excessive unjustified player killing", "destructive behaviour", "spoiling auction", "invalid payment");
$players_banned = $SQL->query('SELECT `bans`.`value`, `bans`.`comment`, `bans`.`admin_id`, `bans`.`expires`, `bans`.`added`, `bans`.`reason` FROM `bans`, `players` WHERE `players`.`account_id` = `bans`.`value` AND `bans`.`type` = 3 AND `bans`.`active` = 1 GROUP BY `bans`.`value` ORDER BY `bans`.`expires`')->fetchAll();
$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();
if($player['admin_id'] == "1")
$banby = "Administrator";
else
$banby = "Auto Ban";
$number_of_players++;
if(is_int($number_of_players / 2))
$bgcolor = $config['site']['darkborder'];
else
$bgcolor = $config['site']['lightborder'];
$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=20%>'.$player['comment'].'</TD><TD>'.$banby.'</TD><TD>'.date("d/m/Y, G:i:s", $player['added']).'</TD><TD>'.date("d/m/Y, G:i:s", $player['expires']).'</TD></TR>';
}
//list of players
$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>Added</center></b></TD><TD class="white"><b><center>Expires</center></b></TD></TR>'.$players_rows.'</TABLE>';
?>
Error that I got in website:
Fatal error: Call to a member function fetchAll() on a non-object in /home/otsmanager/www/public_html/pages/banlist.php on line 4