Ir para conteúdo
  • 0

[ERRO] Pagina de Bans Gesior


Tibiazeiro

Pergunta

Opa galera. Quando acesso a pagina de Bans, ocorre o seguinte erro:

 

Citar

Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\pages\bans.php on line 11

 

Segue o php da pagina Bans que estou usando:

 

Citar

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 50px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
</style>


<?PHP

///
$data = $SQL->query('SELECT `players_data`.`name`, `account_bans`.`account_id`, `account_bans`.`reason`, `account_bans`.`banned_at`, `account_bans`.`expires_at`, `account_bans`.`banned_by` FROM `account_bans` INNER JOIN (SELECT * FROM (SELECT `account_id`, `name` FROM `players` WHERE `players`.`account_id` IN (SELECT `account_id` FROM `account_bans`) ORDER BY `level` DESC) x GROUP BY `account_id`) players_data ON `account_bans`.`account_id` = `players_data`.`account_id`')->fetchAll();
echo '<p align="center"><img src="images/banned.png" alt="*"><br/>


<font color=red>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</font><br/><br/></p>


';
echo ' <table class="tg">
<th class="tg-031e">Number.</th>
<th class="tg-031e">Player</th>
<th class="tg-031e">Reason</th>
<th class="tg-031e">Expires</th>
<tr>

';

foreach($data as $i => $ban)
{
if(!htmlspecialchars($ban['reason'])){
$ban['reason'] = "(None)";
}

$kada1 = $ban['expires_at'] - time();
$kada2 = date("i",$kada1);
$kada3 = date("s",$kada1);
$kada4 = $kada1/60/60;
$kada4 = current(explode(".", $kada4));

if($kada1 < 60)
{
$zodis = "<b>Expires at: $kada1 sec.</b>";
}
elseif($kada4 >= 1)
{
$zodis = "<b>Expires at: $kada4 h, $kada2 min.</b>";
}
elseif($kada2 >= 1)
{
$zodis = "<b>Expires at: $kada2 min, $kada3 sec.</b>";
}

    echo '<td>' .($i+1) . '.</td><td><a href="?subtopic=characters&name=' . urlencode($ban['name']) . '">' . htmlspecialchars($ban['name']) . '</a></td>
   
    <td>' . htmlspecialchars($ban['reason']) . '<br /></td>
    <td>   ' . $zodis . ' </td><tr>';
}
  echo '</table>';
 
  ?>

 

Quem puder ajudar, agradeço :)!

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...