Postado Julho 28, 2016 8 anos Fala galera, estou editando meu site e apareceu esse problema quando eu tento acessar a parte Account do Site: ( http://localhost/account.php) Spoiler Fatal error: Uncaught exception 'DatabaseQueryException' Message: Error #1054:Unknown column 'guilds.owner_id' in 'where clause' SQL query: SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 File: sql.php on line: 94 Script was terminated because something unexpected happened. You can report this, if you think it's a bug. Debug Backtrace: Array ( [0] => Array ( [function] => ExceptionHandler [class] => AAC [type] => :: [args] => Array ( [0] => DatabaseQueryException Object ( [query_str:private] => SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 [help_id:private] => [message:protected] => Error #1054:Unknown column 'guilds.owner_id' in 'where clause' [string:private] => [code:protected] => 0 [file:protected] => C:\xampp\htdocs\class\sql.php [line:protected] => 94 [trace:private] => Array ( [0] => Array ( [file] => C:\xampp\htdocs\class\account.php [line] => 36 [function] => myQuery [class] => SQL [type] => -> [args] => Array ( [0] => SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 ) ) [1] => Array ( [file] => C:\xampp\htdocs\class\account.php [line] => 133 [function] => load_guilds [class] => Account [type] => -> [args] => Array ( ) ) [2] => Array ( [file] => C:\xampp\htdocs\account.php [line] => 61 [function] => __get [class] => Account [type] => -> [args] => Array ( [0] => guilds ) ) ) ) ) ) ) TRABALHOS [iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/ [CreatureScripts] OwNeD ao character morrer: http://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/
Postado Julho 28, 2016 8 anos 10 horas atrás, Ribeiro Foda disse: Fala galera, estou editando meu site e apareceu esse problema quando eu tento acessar a parte Account do Site: ( http://localhost/account.php) Ocultar conteúdo Fatal error: Uncaught exception 'DatabaseQueryException' Message: Error #1054:Unknown column 'guilds.owner_id' in 'where clause' SQL query: SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 File: sql.php on line: 94 Script was terminated because something unexpected happened. You can report this, if you think it's a bug. Debug Backtrace: Array ( [0] => Array ( [function] => ExceptionHandler [class] => AAC [type] => :: [args] => Array ( [0] => DatabaseQueryException Object ( [query_str:private] => SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 [help_id:private] => [message:protected] => Error #1054:Unknown column 'guilds.owner_id' in 'where clause' [string:private] => [code:protected] => 0 [file:protected] => C:\xampp\htdocs\class\sql.php [line:protected] => 94 [trace:private] => Array ( [0] => Array ( [file] => C:\xampp\htdocs\class\account.php [line] => 36 [function] => myQuery [class] => SQL [type] => -> [args] => Array ( [0] => SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = 1 ) ) [1] => Array ( [file] => C:\xampp\htdocs\class\account.php [line] => 133 [function] => load_guilds [class] => Account [type] => -> [args] => Array ( ) ) [2] => Array ( [file] => C:\xampp\htdocs\account.php [line] => 61 [function] => __get [class] => Account [type] => -> [args] => Array ( [0] => guilds ) ) ) ) ) ) ) Manda o seu account.php
Postado Julho 28, 2016 8 anos Autor @Kemmlly Spoiler <?php /* Copyright (C) 2007 - 2009 Nicaw This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ include ("include.inc.php"); try { $account = new Account(); $account->load($_SESSION['account']); } catch(AccountNotFoundException $e) { $_SESSION['account'] = ''; header('location: login.php?redirect=account.php'); die(); } $ptitle="Account - $cfg[server_name]"; include ("header.inc.php"); ?> <div id="content"> <div class="top">Account</div> <div class="mid"> <table style="width: 100%"> <tr style="vertical-align: top"><td style="width: 200px;"> <h3>Pick a Task</h3> <ul class="task-menu"> <li onclick="ajax('ajax','modules/character_create.php','',true)" style="background-image: url(resource/user_add.png);">Create Character</li> <li onclick="ajax('ajax','modules/character_delete.php','',true)" style="background-image: url(resource/user_delete.png);">Delete Character</li> <?php if ($cfg['char_repair']){?> <li onclick="ajax('ajax','modules/character_repair.php','',true)" style="background-image: url(resource/user_edit.png);">Repair Character</li> <?php }?> <li onclick="ajax('ajax','modules/account_password.php','',true)" style="background-image: url(resource/key.png);">Change Password</li> <li onclick="ajax('ajax','modules/account_email.php','',true)" style="background-image: url(resource/email.png);">Change Email</li> <li onclick="ajax('ajax','modules/account_comments.php','',true)" style="background-image: url(resource/page_edit.png);">Edit Comments</li> <li onclick="ajax('ajax','modules/account_options.php','',true)" style="background-image: url(resource/wrench.png);">Account Options</li> <li onclick="ajax('ajax','modules/guild_create.php','',true)" style="background-image: url(resource/group_add.png);">Create Guild</li> <li onclick="window.location.href='login.php?logout&redirect=account.php'" style="background-image: url(resource/resultset_previous.png);">Logout</li> </ul> </td><td style="width: 130px;"> <?php if ($account->players){ echo '<h3>Characters</h3>'."\n"; echo '<ul class="task-menu">'; foreach ($account->players as $player){ echo '<li style="background-image: url(resource/user.png);" onclick="window.location.href=\'characters.php?player_id='.htmlspecialchars($player['id']).'\'">'.htmlspecialchars($player['name']).'</li>'; } echo '</ul>'; } if ($account->guilds){ echo '<h3>Guilds</h3>'."\n"; echo '<ul class="task-menu">'; foreach ($account->guilds as $guild){ echo '<li style="background-image: url(resource/group.png);" onclick="window.location.href=\'guilds.php?guild_id='.htmlspecialchars($guild['id']).'\'">'.htmlspecialchars($guild['name']).'</li>'; } echo '</ul>'; } ?> </td></tr> </table> <?php if(isset($account->attrs['premend']) && $account->attrs['premend'] > time()) { echo '<b>Premium status:</b> You have '; $days = ceil(($account->attrs['premend'] - time())/(3600*24)); if($days <= 5) echo '<b style="color: red">'; else echo '<b>'; echo $days.'</b> day(s) left'; } ?> <div id="ajax"></div> </div> <div class="bot"></div> </div> <?php include ("footer.inc.php"); ?> EDIT: Tem outro account dentro da pasta Class: Spoiler <?php /* Copyright (C) 2007 - 2009 Nicaw This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ class Account { private $attrs, $sql, $guilds, $players; public function __construct() { $this->sql = AAC::$SQL; } public function find($name) { if (empty($name)) throw new AccountNotFoundException(); $acc = $this->sql->myRetrieve('accounts', array('name' => $name)); if ($acc === false) throw new AccountNotFoundException(); $this->load($acc['id']); return true; } public function load_guilds() { if(empty($this->attrs['accno'])) throw new AccountNotLoadedException(); $this->sql->myQuery('SELECT guilds.id, guilds.name FROM guilds, accounts, players WHERE players.id = guilds.owner_id AND players.account_id = accounts.id AND accounts.id = '.$this->sql->quote($this->attrs['accno'])); while ($a = $this->sql->fetch_array()) { $this->guilds[] = array('id' => $a['id'], 'name' => $a['name']); } return true; } public function load_players() { if(empty($this->attrs['accno'])) throw new AccountNotLoadedException(); $this->sql->myQuery('SELECT players.id, players.name FROM players WHERE (`account_id`='.$this->sql->quote($this->attrs['accno']).')'); while ($a = $this->sql->fetch_array()) { $this->players[] = array('name' => $a['name'], 'id' => $a['id']); } return true; } public function load($id) { if (!is_numeric($id)) throw new AccountNotFoundException(); //load attributes from database $acc = $this->sql->myRetrieve('accounts', array('id' => $id)); $nicaw_acc = $this->sql->myRetrieve('nicaw_accounts', array('account_id' => $id)); if ($acc === false) throw new AccountNotFoundException(); //arranging attributes, ones on the left will be used all over the aac $this->attrs['accno'] = (int) $acc['id']; $this->attrs['blocked'] = (bool) $acc['blocked']; $this->attrs['name'] = (string) $acc['name']; $this->attrs['password'] = (string) $acc['password']; $this->attrs['email'] = (string) $acc['email']; $this->attrs['rlname'] = $nicaw_acc['rlname']; $this->attrs['location'] = $nicaw_acc['location']; $this->attrs['comment'] = $nicaw_acc['comment']; $this->attrs['recovery_key'] = $nicaw_acc['recovery_key']; $this->attrs['reveal_characters'] = (bool) $nicaw_acc['reveal_characters']; if (isset($acc['premdays']) && $acc['premdays'] > 0) $this->attrs['premend'] = $acc['premdays']*24*3600 + time(); elseif (isset($acc['premend']) && $acc['premend'] > 0) $this->attrs['premend'] = $acc['premend']; return true; } public function save() { $acc['id'] = $this->attrs['accno']; $acc['name'] = $this->attrs['name']; $acc['password'] = $this->attrs['password']; $acc['email'] = $this->attrs['email']; $this->sql->myUpdate('accounts',$acc, array('id' => $this->attrs['accno'])); $nicaw_acc['account_id'] = $this->attrs['accno']; $nicaw_acc['rlname'] = $this->attrs['rlname']; $nicaw_acc['location'] = $this->attrs['location']; $nicaw_acc['comment'] = $this->attrs['comment']; $nicaw_acc['recovery_key'] = $this->attrs['recovery_key']; $nicaw_acc['reveal_characters'] = $this->attrs['reveal_characters']; $this->sql->myReplace('nicaw_accounts',$nicaw_acc); return true; } public function hasPlayer($pid) { $players = $this->__get('players'); foreach($players as $p) { if ($p['id'] == $pid) { return true; } } return false; } static public function Create($name, $password, $email, $rlname = '', $location = '') { $SQL = AAC::$SQL; unset($d); $d['name'] = $name; $d['password'] = Account::encodePassword($password); $d['email'] = $email; $SQL->myInsert('accounts',$d); $aid = $SQL->insert_id(); unset($d); $d['account_id'] = $aid; $d['rlname'] = $rlname; $d['location'] = $location; $SQL->myInsert('nicaw_accounts',$d); $account = new Account(); $account->load($aid); return $account; } public function __get($attr) { if(empty($this->attrs['accno'])) throw new ClassException('Attempt to get attribute of account that is not loaded.'); if($attr == 'attrs') { return $this->attrs; }elseif($attr == 'guilds') { if(empty($this->guilds)) $this->load_guilds(); return $this->guilds; }elseif($attr == 'players') { if(empty($this->players)) $this->load_players(); return $this->players; }else { throw new ClassException('Undefined property: '.$attr); } } public function setAttr($attr,$value) { $this->attrs[$attr] = $value; } public function setPassword($pass) { if(empty($pass)) return false; $this->attrs['password'] = Account::encodePassword($pass); return true; } static private function encodePassword($pass) {global $cfg; $pass = $pass.$cfg['password_salt']; if ($cfg['password_type'] == 'md5') $pass = md5($pass); elseif ($cfg['password_type'] == 'sha1') $pass = sha1($pass); return $pass; } public function checkPassword($pass) {global $cfg; $pass = $pass.$cfg['password_salt']; if ($cfg['password_type'] == 'md5') { $pass = md5($pass); }elseif ($cfg['password_type'] == 'sha1') { $pass = sha1($pass); }elseif ($cfg['password_type'] == 'plain') { }else throw new ClassException('Unknow password encoding $cfg[\'password_type\'].'); return $this->attrs['password'] == (string)$pass && !empty($pass); } static public function existsName($name) { try { AAC::$SQL->myQuery('SELECT * FROM `accounts` WHERE `name` = '.AAC::$SQL->quote($name)); } catch(DatabaseQueryException $e) { throw new DatabaseException('Account::existsName() failed. If your server doesn\'t support account names pelase use AAC release v3.20'); } if (AAC::$SQL->num_rows() > 0) return true; return false; } public function logAction($action) { $this->sql->myQuery('INSERT INTO `nicaw_account_logs` (id, ip, account_id, date, action) VALUES(NULL, INET_ATON('.$this->sql->quote($_SERVER['REMOTE_ADDR']).'), '.$this->sql->quote($this->attrs['accno']).', UNIX_TIMESTAMP(NOW()), '.$this->sql->quote($action).')'); } public function removeRecoveryKey() { $this->attrs['recovery_key'] = NULL; } public function addRecoveryKey() { $this->attrs['recovery_key'] = substr(str_shuffle(md5(mt_rand()).md5(time())), 0, 32); $this->logAction('Recovery key added'); return $this->attrs['recovery_key']; } public function checkRecoveryKey($key) { return $this->attrs['recovery_key'] === $key && !empty($key); } public function vote($option) { $this->sql->myQuery('INSERT INTO `nicaw_poll_votes` (option_id, ip, account_id) VALUES('.$this->sql->quote($option).', INET_ATON('.$this->sql->quote($_SERVER['REMOTE_ADDR']).'), '.$this->sql->quote($this->attrs['accno']).')'); } public function getMaxLevel() { $this->sql->myQuery('SELECT MAX(level) AS maxlevel FROM `players` WHERE `account_id` = '.$this->sql->quote($this->attrs['accno'])); $row = $this->sql->fetch_array(); return (int) $row['maxlevel']; } public function canVote($option) { $query = 'SELECT nicaw_polls.id FROM nicaw_polls, nicaw_poll_options WHERE nicaw_polls.id = nicaw_poll_options.poll_id AND nicaw_poll_options.id = '.$this->sql->quote($option).' AND '.$this->sql->quote($this->getMaxLevel()).' > minlevel AND nicaw_polls.startdate < UNIX_TIMESTAMP(NOW()) AND nicaw_polls.enddate > UNIX_TIMESTAMP(NOW())'; $this->sql->myQuery($query); if ($this->sql->num_rows() == 0) return false; if ($this->sql->num_rows() > 1) throw new DatabaseException('Unexpected SQL answer.'); $a = $this->sql->fetch_array(); $poll_id = $a['id']; $query = 'SELECT * FROM nicaw_poll_votes, nicaw_poll_options WHERE nicaw_poll_options.poll_id = '.$this->sql->quote($poll_id).' AND nicaw_poll_options.id = nicaw_poll_votes.option_id AND (account_id = '.$this->sql->quote($this->attrs['accno']).' OR ip = INET_ATON('.$this->sql->quote($_SERVER['REMOTE_ADDR']).') )'; $this->sql->myQuery($query); if ($this->sql->num_rows() == 0) return true; elseif ($this->sql->num_rows() == 1) return false; else throw new DatabaseException('Unexpected SQL answer.'); } } ?> Editado Julho 28, 2016 8 anos por Ribeiro Foda 2 Account.php (veja o histórico de edições) TRABALHOS [iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/ [CreatureScripts] OwNeD ao character morrer: http://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/
Postado Julho 28, 2016 8 anos @Ribeiro Foda Esse é o site do fox? Obs: Se ngm te ajudar, eu tenho o account do fox (nicaw.acc) te mando ele certinho.. Vlw.
Postado Julho 28, 2016 8 anos @Ribeiro Foda Mande seu sql.php e tire um print de sua tabela guilds da sua database
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.