Postado Maio 27, 2015 10 anos Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\status.php on line 13 <?php if(!defined('INITIALIZED')) exit; $orderby = 'name'; if(isset($_REQUEST['order'])) { if($_REQUEST['order']== 'level') $orderby = 'level'; elseif($_REQUEST['order'] == 'vocation') $orderby = 'vocation'; } $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ', ' . $SQL->tableName('players_online') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players_online') . '.' . $SQL->fieldName('player_id') . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll(); $number_of_players_online = 0; $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations $players_rows = ''; foreach($players_online_data as $player) { $vocations_online_count[$player['vocation']] += 1; $bgcolor = (($number_of_players_online++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $skull = ''; if ($player['skull'] == 4) $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>"; else if ($player['skull'] == 5) $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>"; $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=65%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).'</TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['vocation']]).'</TD></TR>'; } if($config['site']['private-servlist.com_server_id'] > 0) { $main_content.= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=10% CLASS=white><center><B>Players Online Chart</B></TD></TR></TABLE><table align="center"><tr><td><img src="http://private-servlist.com/server-chart/' . $config['site']['private-servlist.com_server_id'] . '.png" width="500px" /></td></tr></table>'; } if($number_of_players_online == 0) { } else { } -------------------- acho que sei oq pode ser, na minha db n tem a coluna 'flag' alguem pode me passar? fieldName('flag') [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Maio 27, 2015 10 anos Solução alter table `accounts` add `flag` varchar(50) DEFAULT ''; corrigido! Editado Maio 27, 2015 10 anos por alexxxxxxx (veja o histórico de edições) Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Maio 27, 2015 10 anos Autor vou testa qndo chegar em casa, vlw! tbm achei essa: "ALTER TABLE `accounts` ADD `flag` VARCHAR( 255 ) NOT NULL;" [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.