• 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!

Gesior acc error

kapka

New Member
Joined
Aug 3, 2012
Messages
58
Reaction score
0
Hi, i have error in set 4 when im istaling acc maker:
Code:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36

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

class Player extends ObjectData
{
	const LOADTYPE_ID = 'id';
	const LOADTYPE_NAME = 'name';
	const LOADTYPE_ACCOUNT_ID = 'account_id';
	public static $table = 'players';
	public $data = array('name' => null, 'world_id' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'rank_id' => null, 'guildnick' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'direction' => null, 'loss_experience' => null, 'loss_mana' => null, 'loss_skills' => null, 'loss_containers' => null, 'loss_items' => null, 'premend' => null, 'online' => null, 'marriage' => null, 'promotion' => null, 'deleted' => null, 'description' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null);
	public static $fields = array('id', 'name', 'world_id', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'rank_id', 'guildnick', 'lastlogout', 'blessings', 'balance', 'stamina', 'direction', 'loss_experience', 'loss_mana', 'loss_skills', 'loss_containers', 'loss_items', 'premend', 'online', 'marriage', 'promotion', 'deleted', 'description', 'create_ip', 'create_date', 'comment', 'hide_char');
	public static $skillFields = array('player_id', 'skillid', 'value',	'count');
	public $items;
	public $storages;
	public $skills;
	public $account;
	public $rank;

    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
		if($search_text != null)
			$this->load($search_text, $search_by);
    }

	public function load($search_text, $search_by = self::LOADTYPE_ID)
	{
		if(in_array($search_by, self::$fields))
			$search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
		else
			new Error_Critic('', 'Wrong Player search_by type.');
		$fieldsArray = array();
		foreach(self::$fields as $fieldName)
			$fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

		$this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
	}

	public function loadById($id)
	{
		$this->load($id, self::LOADTYPE_ID);
	}

	public function loadByName($name)
	{
		$this->load($name, self::LOADTYPE_NAME);
	}

	public function save($forceInsert = false)
	{
		if(!isset($this->data['id']) || $forceInsert)
		{
			$keys = array();
			$values = array();
			foreach(self::$fields as $key)
				if($key != 'id')
				{
					$keys[] = $this->getDatabaseHandler()->fieldName($key);
					$values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
				}
			$this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
			$this->setID($this->getDatabaseHandler()->lastInsertId());
		}
		else
		{
			$updates = array();
			foreach(self::$fields as $key)
				$updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
			$this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
		}
	}

	public function getItems($forceReload = false)
	{
		if(!isset($this->items) || $forceReload)
			$this->items = new ItemsList($this->getID());

		return $this->items;
	}

	public function saveItems()
	{
		if(isset($this->items))
		{
			// if any script changed ID of player, function should save items with new player id
			$this->items->setPlayerId($this->getID());
			$this->items->save();
		}
		else
			new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save');
	}

	public function loadStorages()
	{
		$this->storages = array();
		// load all
		$storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
			', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
			' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
		foreach($storages as $storage)
		{
			$this->storages[$storage['key']] = $storage['value'];
		}
	}

	public function saveStorages()
	{
		if(isset($this->storages))
		{
			$this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
			foreach($this->storages as $key => $value)
			{
				//save each
				$this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . 
					$this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . 
					$this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')');
			}
		}
		else
			new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save');
	}

	public function getStorage($key)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		if(isset($this->storages[$key]))
			return $this->storages[$key];
		else
			return null;
	}

	public function getStorages()
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		return $this->storages;
	}

	public function setStorage($key, $value)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		$this->storages[$key] = $value;
	}

	public function removeStorage($key)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		if(isset($this->storages[$key]))
			unset($this->storages[$key]);
	}

	public function loadSkills()
	{
		$fieldsArray = array();
		foreach(self::$skillFields as $fieldName)
			$fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

		$skills = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->fieldName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetchAll();
		$this->skills = array();
		foreach($skills as $skill)
			$this->skills[$skill['skillid']] = $skill;
	}

	public function getSkills($forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		return $this->skills;
	}

	public function getSkill($id, $forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		if(isset($this->skills[$id]))
			return $this->skills[$id]['value'];
		else
			new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist');
	}

	public function setSkill($id, $value)
	{
		$this->skills[$id]['value'] = $value;
	}

	public function getSkillCount($id, $forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		if(isset($this->skills[$id]))
			return $this->skills[$id]['count'];
		else
			new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist');
	}

	public function setSkillCount($id, $count)
	{
		$this->skills[$id]['count'] = $count;
	}

	public function saveSkills()
	{
		if(isset($this->skills))
		{
			$this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));

			if(count($this->skills) > 0)
			{
				$keys = array();
				foreach(self::$skillFields as $key)
					$keys[] = $this->getDatabaseHandler()->fieldName($key);

				$query = 'INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_skills') . ' (' . implode(', ', $keys) . ') VALUES ';
				foreach($this->skills as $skill)
				{
					$fieldValues = array();
					foreach(self::$skillFields as $key)
						if($key != 'player_id')
							$fieldValues[] = $this->getDatabaseHandler()->quote($skill[$key]);
						else
							$fieldValues[] = $this->getDatabaseHandler()->quote($this->getID());
					$this->getDatabaseHandler()->query($query . '(' . implode(', ', $fieldValues) . ')');
				}
			}
		}
		else
			new Error_Critic('', 'Player::saveSkills() - skills not loaded, cannot save');
	}

	public function loadAccount()
	{
		$this->account = new Account($this->getAccountID());
	}

	public function getAccount($forceReload = false)
	{
		if(!isset($this->account) || $forceReload)
			$this->loadAccount();

		return $this->account;
	}

	public function setAccount($account)
	{
		$this->account = $account;
		$this->setAccountID($account->getID());
	}

	public function loadRank()
	{
		$this->rank = new GuildRank($this->getRankID());
	}

	public function getRank($forceReload = false)
	{
		if(!isset($this->rank) || $forceReload)
			$this->loadRank();

        if($this->data['rank_id'] == 0)
        {
            return null;
        }

		return $this->rank;
	}

	public function setRank($rank = null)
	{
		if(isset($rank))
		{
			$this->rank = $rank;
			$this->setRankID($rank->getID());
		}
		else
		{
			$this->rank = new GuildRank();
			$this->setRankID(0);
		}
	}

	public function hasGuild()
	{
		return $this->getRank()->isLoaded();
	}

	public function removeGuildInvitations()
	{
		$this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
	}

	public function unban()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$bans->setFilter($filter);
		foreach($bans as $ban)
		{
			$ban->setActive(0);
			$ban->save();
		}
	}

	public function isBanned()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_BANISHMENT);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam);
		$bans->setFilter($filter);
		$isBanned = false;
		foreach($bans as $ban)
		{
			if($ban->getExpires() <= 0 || $ban->isExpires() > time())
				$isBanned = true;
		}
		return $isBanned;
	}

	public function isNamelocked()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_LOCK);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam);
		$bans->setFilter($filter);
		return (count($bans) > 0);
	}

	public function delete()
	{
        $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));

        unset($this->data['id']);
	}
/*
 * default tfs 0.3.6 fields
*/
	public function setID($value){$this->data['id'] = $value;}
	public function getID(){return $this->data['id'];}
	public function setAccountID($value){$this->data['account_id'] = $value;}
	public function getAccountID(){return $this->data['account_id'];}
	public function setWorldID($value){$this->data['world_id'] = $value;}
	public function getWorldID(){return $this->data['world_id'];}
	public function setName($value){$this->data['name'] = $value;}
	public function getName(){return $this->data['name'];}
	public function setGroupID($value){$this->data['group_id'] = $value;}
	public function getGroupID(){return $this->data['group_id'];}
	public function setVocation($value){$this->data['vocation'] = $value;}
	public function getVocation(){return $this->data['vocation'];}
	public function setPromotion($value){$this->data['promotion'] = $value;}
	public function getPromotion(){return $this->data['promotion'];}
	public function setLevel($value){$this->data['level'] = $value;}
	public function getLevel(){return $this->data['level'];}
	public function setExperience($value){$this->data['experience'] = $value;}
	public function getExperience(){return $this->data['experience'];}
	public function setHealth($value){$this->data['health'] = $value;}
	public function getHealth(){return $this->data['health'];}
	public function setHealthMax($value){$this->data['healthmax'] = $value;}
	public function getHealthMax(){return $this->data['healthmax'];}
	public function setMana($value){$this->data['mana'] = $value;}
	public function getMana(){return $this->data['mana'];}
	public function setManaMax($value){$this->data['manamax'] = $value;}
	public function getManaMax(){return $this->data['manamax'];}
	public function setMagLevel($value){$this->data['maglevel'] = $value;}
	public function getMagLevel(){return $this->data['maglevel'];}
	public function setManaSpent($value){$this->data['manaspent'] = $value;}
	public function getManaSpent(){return $this->data['manaspent'];}
	public function setSex($value){$this->data['sex'] = $value;}
	public function getSex(){return $this->data['sex'];}
	public function setTown($value){$this->data['town_id'] = $value;}
	public function getTown(){return $this->data['town_id'];}
	public function setPosX($value){$this->data['posx'] = $value;}
	public function getPosX(){return $this->data['posx'];}
	public function setPosY($value){$this->data['posy'] = $value;}
	public function getPosY(){return $this->data['posy'];}
	public function setPosZ($value){$this->data['posz'] = $value;}
	public function getPosZ(){return $this->data['posz'];}
	public function setCapacity($value){$this->data['cap'] = $value;}
	public function getCapacity(){return $this->data['cap'];}
	public function setSoul($value){$this->data['soul'] = $value;}
	public function getSoul(){return $this->data['soul'];}
	public function setConditions($value){$this->data['conditions'] = $value;}
	public function getConditions(){return $this->data['conditions'];}
	public function setLastIP($value){$this->data['lastip'] = $value;}
	public function getLastIP(){return $this->data['lastip'];}
	public function setLastLogin($value){$this->data['lastlogin'] = $value;}
	public function getLastLogin(){return $this->data['lastlogin'];}
	public function setLastLogout($value){$this->data['lastlogout'] = $value;}
	public function getLastLogout(){return $this->data['lastlogout'];}
	public function setSkull($value){$this->data['skull'] = $value;}
	public function getSkull(){return $this->data['skull'];}
	public function setSkullTime($value){$this->data['skulltime'] = $value;}
	public function getSkullTime(){return $this->data['skulltime'];}
	public function setRankID($value){$this->data['rank_id'] = $value;}
	public function getRankID(){return $this->data['rank_id'];}
	public function setGuildNick($value){$this->data['guildnick'] = $value;}
	public function getGuildNick(){return $this->data['guildnick'];}
	public function setSave($value = 1){$this->data['save'] = (int) $value;}
	public function getSave(){return $this->data['save'];}
	public function setBlessings($value){$this->data['blessings'] = $value;}
	public function getBlessings(){return $this->data['blessings'];}
	public function setBalance($value){$this->data['balance'] = $value;}
	public function getBalance(){return $this->data['balance'];}
	public function setStamina($value){$this->data['stamina'] = $value;}
	public function getStamina(){return $this->data['stamina'];}
	public function setDirection($value){$this->data['direction'] = $value;}
	public function getDirection(){return $this->data['direction'];}
	public function setLossExperience($value){$this->data['loss_experience'] = $value;}
	public function getLossExperience(){return $this->data['loss_experience'];}
	public function setLossMana($value){$this->data['loss_mana'] = $value;}
	public function getLossMana(){return $this->data['loss_mana'];}
	public function setLossSkills($value){$this->data['loss_skills'] = $value;}
	public function getLossSkills(){return $this->data['loss_skills'];}
	public function setLossContainers($value){$this->data['loss_containers'] = $value;}
	public function getLossContainers(){return $this->data['loss_containers'];}
	public function setLossItems($value){$this->data['loss_items'] = $value;}
	public function getLossItems(){return $this->data['loss_items'];}
	public function setOnline($value){$this->data['online'] = (int) $value;}
	public function getOnline(){return (bool) $this->data['online'];}
	public function setMarriage($value){$this->data['marriage'] = $value;}
	public function getMarriage(){return $this->data['marriage'];}
	public function setDeleted($value){$this->data['deleted'] = (int) $value;}
	public function isDeleted(){return (bool) $this->data['deleted'];}
	public function setDescription($value){$this->data['description'] = $value;}
	public function getDescription(){return $this->data['description'];}
	public function setLookBody($value){$this->data['lookbody'] = $value;}
	public function getLookBody(){return $this->data['lookbody'];}
	public function setLookFeet($value){$this->data['lookfeet'] = $value;}
	public function getLookFeet(){return $this->data['lookfeet'];}
	public function setLookHead($value){$this->data['lookhead'] = $value;}
	public function getLookHead(){return $this->data['lookhead'];}
	public function setLookLegs($value){$this->data['looklegs'] = $value;}
	public function getLookLegs(){return $this->data['looklegs'];}
	public function setLookType($value){$this->data['looktype'] = $value;}
	public function getLookType(){return $this->data['looktype'];}
	public function setLookAddons($value){$this->data['lookaddons'] = $value;}
	public function getLookAddons(){return $this->data['lookaddons'];}
/*
 * Custom AAC fields
 * create_ip , INT, default 0
 * create_date , INT, default 0
 * hide_char , INT, default 0
 * comment , TEXT, default ''
*/
	public function setCreateIP($value){$this->data['create_ip'] = $value;}
	public function getCreateIP(){return $this->data['create_ip'];}
	public function setCreateDate($value){$this->data['create_date'] = $value;}
	public function getCreateDate(){return $this->data['create_date'];}
	public function setHidden($value){$this->data['hide_char'] = (int) $value;}
	public function isHidden(){return (bool) $this->data['hide_char'];}
	public function setComment($value){$this->data['comment'] = $value;}
	public function getComment(){return $this->data['comment'];}
/*
 * for compability with old scripts
*/
	public function setGroup($value){$this->setGroupID($value);}
	public function getGroup(){return $this->getGroupID();}
	public function setWorld($value){$this->setWorldID($value);}
	public function getWorld(){return $this->getWorldID();}
	public function isOnline(){return $this->getOnline() == 1;}
	public function getCreated(){return $this->getCreateDate();}
	public function setCreated($value){$this->setCreateDate($value);}
	public function setCap($value){$this->setCapacity($value);}
	public function getCap(){return $this->getCapacity();}
	public function isSaveSet(){return $this->getSave();}
	public function unsetSave(){$this->setSave(0);}
	public function getTownId(){return $this->getTown();}
	public function getHideChar(){return $this->isHidden();}
	public function find($name){$this->loadByName($name);}
}
 
Code:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36
This means that one qeury coulnt be returned thats when the statement false come in...

fetch(); works on objects only but since the query returns false it makes this error...


well i not been so much on gesior so i cant tell which query Stament is wrong.. but you can se it on which line it is on.
 
Hi, i have error in set 4 when im istaling acc maker:
Code:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36

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

class Player extends ObjectData
{
	const LOADTYPE_ID = 'id';
	const LOADTYPE_NAME = 'name';
	const LOADTYPE_ACCOUNT_ID = 'account_id';
	public static $table = 'players';
	public $data = array('name' => null, 'world_id' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'rank_id' => null, 'guildnick' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'direction' => null, 'loss_experience' => null, 'loss_mana' => null, 'loss_skills' => null, 'loss_containers' => null, 'loss_items' => null, 'premend' => null, 'online' => null, 'marriage' => null, 'promotion' => null, 'deleted' => null, 'description' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null);
	public static $fields = array('id', 'name', 'world_id', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'rank_id', 'guildnick', 'lastlogout', 'blessings', 'balance', 'stamina', 'direction', 'loss_experience', 'loss_mana', 'loss_skills', 'loss_containers', 'loss_items', 'premend', 'online', 'marriage', 'promotion', 'deleted', 'description', 'create_ip', 'create_date', 'comment', 'hide_char');
	public static $skillFields = array('player_id', 'skillid', 'value',	'count');
	public $items;
	public $storages;
	public $skills;
	public $account;
	public $rank;

    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
		if($search_text != null)
			$this->load($search_text, $search_by);
    }

	public function load($search_text, $search_by = self::LOADTYPE_ID)
	{
		if(in_array($search_by, self::$fields))
			$search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
		else
			new Error_Critic('', 'Wrong Player search_by type.');
		$fieldsArray = array();
		foreach(self::$fields as $fieldName)
			$fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

		$this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
	}

	public function loadById($id)
	{
		$this->load($id, self::LOADTYPE_ID);
	}

	public function loadByName($name)
	{
		$this->load($name, self::LOADTYPE_NAME);
	}

	public function save($forceInsert = false)
	{
		if(!isset($this->data['id']) || $forceInsert)
		{
			$keys = array();
			$values = array();
			foreach(self::$fields as $key)
				if($key != 'id')
				{
					$keys[] = $this->getDatabaseHandler()->fieldName($key);
					$values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
				}
			$this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
			$this->setID($this->getDatabaseHandler()->lastInsertId());
		}
		else
		{
			$updates = array();
			foreach(self::$fields as $key)
				$updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
			$this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
		}
	}

	public function getItems($forceReload = false)
	{
		if(!isset($this->items) || $forceReload)
			$this->items = new ItemsList($this->getID());

		return $this->items;
	}

	public function saveItems()
	{
		if(isset($this->items))
		{
			// if any script changed ID of player, function should save items with new player id
			$this->items->setPlayerId($this->getID());
			$this->items->save();
		}
		else
			new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save');
	}

	public function loadStorages()
	{
		$this->storages = array();
		// load all
		$storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
			', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
			' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
		foreach($storages as $storage)
		{
			$this->storages[$storage['key']] = $storage['value'];
		}
	}

	public function saveStorages()
	{
		if(isset($this->storages))
		{
			$this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
			foreach($this->storages as $key => $value)
			{
				//save each
				$this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . 
					$this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . 
					$this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')');
			}
		}
		else
			new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save');
	}

	public function getStorage($key)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		if(isset($this->storages[$key]))
			return $this->storages[$key];
		else
			return null;
	}

	public function getStorages()
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		return $this->storages;
	}

	public function setStorage($key, $value)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		$this->storages[$key] = $value;
	}

	public function removeStorage($key)
	{
		if(!isset($this->storages))
		{
			$this->loadStorages();
		}
		if(isset($this->storages[$key]))
			unset($this->storages[$key]);
	}

	public function loadSkills()
	{
		$fieldsArray = array();
		foreach(self::$skillFields as $fieldName)
			$fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

		$skills = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->fieldName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetchAll();
		$this->skills = array();
		foreach($skills as $skill)
			$this->skills[$skill['skillid']] = $skill;
	}

	public function getSkills($forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		return $this->skills;
	}

	public function getSkill($id, $forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		if(isset($this->skills[$id]))
			return $this->skills[$id]['value'];
		else
			new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist');
	}

	public function setSkill($id, $value)
	{
		$this->skills[$id]['value'] = $value;
	}

	public function getSkillCount($id, $forceReload = false)
	{
		if(!isset($this->skills) || $forceReload)
			$this->loadSkills();

		if(isset($this->skills[$id]))
			return $this->skills[$id]['count'];
		else
			new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist');
	}

	public function setSkillCount($id, $count)
	{
		$this->skills[$id]['count'] = $count;
	}

	public function saveSkills()
	{
		if(isset($this->skills))
		{
			$this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('player_skills') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));

			if(count($this->skills) > 0)
			{
				$keys = array();
				foreach(self::$skillFields as $key)
					$keys[] = $this->getDatabaseHandler()->fieldName($key);

				$query = 'INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_skills') . ' (' . implode(', ', $keys) . ') VALUES ';
				foreach($this->skills as $skill)
				{
					$fieldValues = array();
					foreach(self::$skillFields as $key)
						if($key != 'player_id')
							$fieldValues[] = $this->getDatabaseHandler()->quote($skill[$key]);
						else
							$fieldValues[] = $this->getDatabaseHandler()->quote($this->getID());
					$this->getDatabaseHandler()->query($query . '(' . implode(', ', $fieldValues) . ')');
				}
			}
		}
		else
			new Error_Critic('', 'Player::saveSkills() - skills not loaded, cannot save');
	}

	public function loadAccount()
	{
		$this->account = new Account($this->getAccountID());
	}

	public function getAccount($forceReload = false)
	{
		if(!isset($this->account) || $forceReload)
			$this->loadAccount();

		return $this->account;
	}

	public function setAccount($account)
	{
		$this->account = $account;
		$this->setAccountID($account->getID());
	}

	public function loadRank()
	{
		$this->rank = new GuildRank($this->getRankID());
	}

	public function getRank($forceReload = false)
	{
		if(!isset($this->rank) || $forceReload)
			$this->loadRank();

        if($this->data['rank_id'] == 0)
        {
            return null;
        }

		return $this->rank;
	}

	public function setRank($rank = null)
	{
		if(isset($rank))
		{
			$this->rank = $rank;
			$this->setRankID($rank->getID());
		}
		else
		{
			$this->rank = new GuildRank();
			$this->setRankID(0);
		}
	}

	public function hasGuild()
	{
		return $this->getRank()->isLoaded();
	}

	public function removeGuildInvitations()
	{
		$this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
	}

	public function unban()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$bans->setFilter($filter);
		foreach($bans as $ban)
		{
			$ban->setActive(0);
			$ban->save();
		}
	}

	public function isBanned()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_BANISHMENT);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam);
		$bans->setFilter($filter);
		$isBanned = false;
		foreach($bans as $ban)
		{
			if($ban->getExpires() <= 0 || $ban->isExpires() > time())
				$isBanned = true;
		}
		return $isBanned;
	}

	public function isNamelocked()
	{
		$bans = new DatabaseList('Ban');
		$filterType = new SQL_Filter(new SQL_Field('type'), SQL_Filter::EQUAL, Ban::TYPE_PLAYER);
		$filterParam = new SQL_Filter(new SQL_Field('param'), SQL_Filter::EQUAL, Ban::PLAYERBAN_LOCK);
		$filterValue = new SQL_Filter(new SQL_Field('value'), SQL_Filter::EQUAL, $this->data['id']);
		$filterActive = new SQL_Filter(new SQL_Field('active'), SQL_Filter::EQUAL, 1);
		$filter = new SQL_Filter($filterType, SQL_Filter::CRITERIUM_AND, $filterValue);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterActive);
		$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterParam);
		$bans->setFilter($filter);
		return (count($bans) > 0);
	}

	public function delete()
	{
        $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));

        unset($this->data['id']);
	}
/*
 * default tfs 0.3.6 fields
*/
	public function setID($value){$this->data['id'] = $value;}
	public function getID(){return $this->data['id'];}
	public function setAccountID($value){$this->data['account_id'] = $value;}
	public function getAccountID(){return $this->data['account_id'];}
	public function setWorldID($value){$this->data['world_id'] = $value;}
	public function getWorldID(){return $this->data['world_id'];}
	public function setName($value){$this->data['name'] = $value;}
	public function getName(){return $this->data['name'];}
	public function setGroupID($value){$this->data['group_id'] = $value;}
	public function getGroupID(){return $this->data['group_id'];}
	public function setVocation($value){$this->data['vocation'] = $value;}
	public function getVocation(){return $this->data['vocation'];}
	public function setPromotion($value){$this->data['promotion'] = $value;}
	public function getPromotion(){return $this->data['promotion'];}
	public function setLevel($value){$this->data['level'] = $value;}
	public function getLevel(){return $this->data['level'];}
	public function setExperience($value){$this->data['experience'] = $value;}
	public function getExperience(){return $this->data['experience'];}
	public function setHealth($value){$this->data['health'] = $value;}
	public function getHealth(){return $this->data['health'];}
	public function setHealthMax($value){$this->data['healthmax'] = $value;}
	public function getHealthMax(){return $this->data['healthmax'];}
	public function setMana($value){$this->data['mana'] = $value;}
	public function getMana(){return $this->data['mana'];}
	public function setManaMax($value){$this->data['manamax'] = $value;}
	public function getManaMax(){return $this->data['manamax'];}
	public function setMagLevel($value){$this->data['maglevel'] = $value;}
	public function getMagLevel(){return $this->data['maglevel'];}
	public function setManaSpent($value){$this->data['manaspent'] = $value;}
	public function getManaSpent(){return $this->data['manaspent'];}
	public function setSex($value){$this->data['sex'] = $value;}
	public function getSex(){return $this->data['sex'];}
	public function setTown($value){$this->data['town_id'] = $value;}
	public function getTown(){return $this->data['town_id'];}
	public function setPosX($value){$this->data['posx'] = $value;}
	public function getPosX(){return $this->data['posx'];}
	public function setPosY($value){$this->data['posy'] = $value;}
	public function getPosY(){return $this->data['posy'];}
	public function setPosZ($value){$this->data['posz'] = $value;}
	public function getPosZ(){return $this->data['posz'];}
	public function setCapacity($value){$this->data['cap'] = $value;}
	public function getCapacity(){return $this->data['cap'];}
	public function setSoul($value){$this->data['soul'] = $value;}
	public function getSoul(){return $this->data['soul'];}
	public function setConditions($value){$this->data['conditions'] = $value;}
	public function getConditions(){return $this->data['conditions'];}
	public function setLastIP($value){$this->data['lastip'] = $value;}
	public function getLastIP(){return $this->data['lastip'];}
	public function setLastLogin($value){$this->data['lastlogin'] = $value;}
	public function getLastLogin(){return $this->data['lastlogin'];}
	public function setLastLogout($value){$this->data['lastlogout'] = $value;}
	public function getLastLogout(){return $this->data['lastlogout'];}
	public function setSkull($value){$this->data['skull'] = $value;}
	public function getSkull(){return $this->data['skull'];}
	public function setSkullTime($value){$this->data['skulltime'] = $value;}
	public function getSkullTime(){return $this->data['skulltime'];}
	public function setRankID($value){$this->data['rank_id'] = $value;}
	public function getRankID(){return $this->data['rank_id'];}
	public function setGuildNick($value){$this->data['guildnick'] = $value;}
	public function getGuildNick(){return $this->data['guildnick'];}
	public function setSave($value = 1){$this->data['save'] = (int) $value;}
	public function getSave(){return $this->data['save'];}
	public function setBlessings($value){$this->data['blessings'] = $value;}
	public function getBlessings(){return $this->data['blessings'];}
	public function setBalance($value){$this->data['balance'] = $value;}
	public function getBalance(){return $this->data['balance'];}
	public function setStamina($value){$this->data['stamina'] = $value;}
	public function getStamina(){return $this->data['stamina'];}
	public function setDirection($value){$this->data['direction'] = $value;}
	public function getDirection(){return $this->data['direction'];}
	public function setLossExperience($value){$this->data['loss_experience'] = $value;}
	public function getLossExperience(){return $this->data['loss_experience'];}
	public function setLossMana($value){$this->data['loss_mana'] = $value;}
	public function getLossMana(){return $this->data['loss_mana'];}
	public function setLossSkills($value){$this->data['loss_skills'] = $value;}
	public function getLossSkills(){return $this->data['loss_skills'];}
	public function setLossContainers($value){$this->data['loss_containers'] = $value;}
	public function getLossContainers(){return $this->data['loss_containers'];}
	public function setLossItems($value){$this->data['loss_items'] = $value;}
	public function getLossItems(){return $this->data['loss_items'];}
	public function setOnline($value){$this->data['online'] = (int) $value;}
	public function getOnline(){return (bool) $this->data['online'];}
	public function setMarriage($value){$this->data['marriage'] = $value;}
	public function getMarriage(){return $this->data['marriage'];}
	public function setDeleted($value){$this->data['deleted'] = (int) $value;}
	public function isDeleted(){return (bool) $this->data['deleted'];}
	public function setDescription($value){$this->data['description'] = $value;}
	public function getDescription(){return $this->data['description'];}
	public function setLookBody($value){$this->data['lookbody'] = $value;}
	public function getLookBody(){return $this->data['lookbody'];}
	public function setLookFeet($value){$this->data['lookfeet'] = $value;}
	public function getLookFeet(){return $this->data['lookfeet'];}
	public function setLookHead($value){$this->data['lookhead'] = $value;}
	public function getLookHead(){return $this->data['lookhead'];}
	public function setLookLegs($value){$this->data['looklegs'] = $value;}
	public function getLookLegs(){return $this->data['looklegs'];}
	public function setLookType($value){$this->data['looktype'] = $value;}
	public function getLookType(){return $this->data['looktype'];}
	public function setLookAddons($value){$this->data['lookaddons'] = $value;}
	public function getLookAddons(){return $this->data['lookaddons'];}
/*
 * Custom AAC fields
 * create_ip , INT, default 0
 * create_date , INT, default 0
 * hide_char , INT, default 0
 * comment , TEXT, default ''
*/
	public function setCreateIP($value){$this->data['create_ip'] = $value;}
	public function getCreateIP(){return $this->data['create_ip'];}
	public function setCreateDate($value){$this->data['create_date'] = $value;}
	public function getCreateDate(){return $this->data['create_date'];}
	public function setHidden($value){$this->data['hide_char'] = (int) $value;}
	public function isHidden(){return (bool) $this->data['hide_char'];}
	public function setComment($value){$this->data['comment'] = $value;}
	public function getComment(){return $this->data['comment'];}
/*
 * for compability with old scripts
*/
	public function setGroup($value){$this->setGroupID($value);}
	public function getGroup(){return $this->getGroupID();}
	public function setWorld($value){$this->setWorldID($value);}
	public function getWorld(){return $this->getWorldID();}
	public function isOnline(){return $this->getOnline() == 1;}
	public function getCreated(){return $this->getCreateDate();}
	public function setCreated($value){$this->setCreateDate($value);}
	public function setCap($value){$this->setCapacity($value);}
	public function getCap(){return $this->getCapacity();}
	public function isSaveSet(){return $this->getSave();}
	public function unsetSave(){$this->setSave(0);}
	public function getTownId(){return $this->getTown();}
	public function getHideChar(){return $this->isHidden();}
	public function find($name){$this->loadByName($name);}
}
To view query which is wrong you must edit index.php file. There is line:
PHP:
define('DEBUG_DATABASE', false);
Change it to true, then last query before fatal error will be query that can't execute. Copy it (or paste all text from page and I will find bad query) and paste in phpmyadmin in 'SQL', execute it and phpmyadmin will tell you what is wrong.
If any class of acc. maker throws 'Call to a member function fetch() on a non-object' it means that you don't have some required column or table in database. Maybe reinstall acc. maker? (make file 'install.txt' in main folder with your IP in it to make acc. maker start installation again
 
I Changed that to true but its still :
PHP:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36
i pasted player.php yealier.
in step 3 i have this error:
Code:
Add tables and columns to DB
Installer try to add new tables and columns to database.
Could not add column key to table accounts. Already exist?
Could not add column email_new to table accounts. Already exist?
Could not add column email_new_time to table accounts. Already exist?
Could not add column rlname to table accounts. Already exist?
Could not add column location to table accounts. Already exist?
Could not add column page_access to table accounts. Already exist?
Could not add column email_code to table accounts. Already exist?
Could not add column next_email to table accounts. Already exist?
Could not add column premium_points to table accounts. Already exist?
Could not add column create_date to table accounts. Already exist?
Could not add column create_ip to table accounts. Already exist?
Could not add column last_post to table accounts. Already exist?
Could not add column flag to table accounts. Already exist?
Could not add column description to table guilds. Already exist?
Could not add column guild_logo to table guilds. Already exist?
Could not add column create_ip to table guilds. Already exist?
Could not add column balance to table guilds. Already exist?
Could not add column war to table killers. Already exist?
Could not add column deleted to table players. Already exist?
Could not add column description to table players. Already exist?
Could not add column comment to table players. Already exist?
Could not add column create_ip to table players. Already exist?
Could not add column create_date to table players. Already exist?
Could not add column hide_char to table players. Already exist?
Could not create table z_ots_comunication. Already exist?
Could not create table z_shop_offer. Already exist?
Could not create table z_shop_history_item. Already exist?
Could not create table z_forum. Already exist?
Tables and columns added to database.
Go to STEP 4 - Add samples
 
I Changed that to true but its still :
PHP:
Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36
i pasted player.php yealier.
in step 3 i have this error:
Code:
Add tables and columns to DB
Installer try to add new tables and columns to database.
Could not add column key to table accounts. Already exist?
Could not add column email_new to table accounts. Already exist?
Could not add column email_new_time to table accounts. Already exist?
Could not add column rlname to table accounts. Already exist?
Could not add column location to table accounts. Already exist?
Could not add column page_access to table accounts. Already exist?
Could not add column email_code to table accounts. Already exist?
Could not add column next_email to table accounts. Already exist?
Could not add column premium_points to table accounts. Already exist?
Could not add column create_date to table accounts. Already exist?
Could not add column create_ip to table accounts. Already exist?
Could not add column last_post to table accounts. Already exist?
Could not add column flag to table accounts. Already exist?
Could not add column description to table guilds. Already exist?
Could not add column guild_logo to table guilds. Already exist?
Could not add column create_ip to table guilds. Already exist?
Could not add column balance to table guilds. Already exist?
Could not add column war to table killers. Already exist?
Could not add column deleted to table players. Already exist?
Could not add column description to table players. Already exist?
Could not add column comment to table players. Already exist?
Could not add column create_ip to table players. Already exist?
Could not add column create_date to table players. Already exist?
Could not add column hide_char to table players. Already exist?
Could not create table z_ots_comunication. Already exist?
Could not create table z_shop_offer. Already exist?
Could not create table z_shop_history_item. Already exist?
Could not create table z_forum. Already exist?
Tables and columns added to database.
Go to STEP 4 - Add samples

That is not error? It means you already have the tables
 
so what should i do? i can step to step 4 but cant go to 5 cuz got error which i describe ealier. i downloaded acc maker from:
Latestnews - Forgotten
If it appear while installation then edit install.php find line (221):
PHP:
$SQL = Website::getDBHandle();
and under it paste:
PHP:
Website::getDBHandle()->setPrintQueries(true);
Then try to open bugged site again.
We are talking about acc. maker, not TFS and it's for 0.3.6.
 
when i pasted it its now something like that:
Code:
STEP 4

Add samples to DB:
Query:	SELECT "id", "name", "world_id", "group_id", "account_id", "level", "vocation", "health", "healthmax", "experience", "lookbody", "lookfeet", "lookhead", "looklegs", "looktype", "lookaddons", "maglevel", "mana", "manamax", "manaspent", "soul", "town_id", "posx", "posy", "posz", "conditions", "cap", "sex", "lastlogin", "lastip", "save", "skull", "skulltime", "rank_id", "guildnick", "lastlogout", "blessings", "balance", "stamina", "direction", "loss_experience", "loss_mana", "loss_skills", "loss_containers", "loss_items", "premend", "online", "marriage", "promotion", "deleted", "description", "create_ip", "create_date", "comment", "hide_char" FROM "players" WHERE "name" = 'Account Manager'
SQLSTATE:	HY000
Driver code:	1
Error message:	no such table: players

Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36
 
1. Go config.lua (of TFS) and edit database settings. Set sqlType = "mysql"
2. If you want use sqlite database you must use database that you get with TFS (file is in main folder and ends with .s3db)

This error means that in database is no table 'players' and from SQL query I can read that you use SQLite [in config.lua it's "sqlite"], not MySQL (column names are in ", for MySQL acc. maker put them in ` ).
 
it works, thanks alot, i stayed in sqlite database, but if mysql changes something or its better tell me, please

first post at website its:
Code:
Query:	SELECT "g"."id" AS "id", "g"."name" AS "name", 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 "g"."id" > 0 AND "k"."unjustified" = 1 AND "k"."final_hit" = 1 GROUP BY "name" ORDER BY "frags" DESC, "name" ASC LIMIT 4;
SQLSTATE:	00000
Driver code:	
Error message:	
Query:	SELECT "players"."name", "z_forum"."post_text", "z_forum"."post_topic", "z_forum"."post_smile", "z_forum"."id", "z_forum"."replies", "z_forum"."post_date" FROM "players", "z_forum" WHERE "players"."id" = "z_forum"."author_guid" AND "z_forum"."section" = 1 AND "z_forum"."first_post" = "z_forum"."id" ORDER BY "z_forum"."last_post" DESC LIMIT 6
SQLSTATE:	00000
Driver code:	
Error message:

for e.x after highscores there are:
Code:
Query:	SELECT "players"."id", "players"."name", "players"."world_id", "players"."group_id", "players"."account_id", "players"."level", "players"."vocation", "players"."health", "players"."healthmax", "players"."experience", "players"."lookbody", "players"."lookfeet", "players"."lookhead", "players"."looklegs", "players"."looktype", "players"."lookaddons", "players"."maglevel", "players"."mana", "players"."manamax", "players"."manaspent", "players"."soul", "players"."town_id", "players"."posx", "players"."posy", "players"."posz", "players"."conditions", "players"."cap", "players"."sex", "players"."lastlogin", "players"."lastip", "players"."save", "players"."skull", "players"."skulltime", "players"."rank_id", "players"."guildnick", "players"."lastlogout", "players"."blessings", "players"."balance", "players"."stamina", "players"."direction", "players"."loss_experience", "players"."loss_mana", "players"."loss_skills", "players"."loss_containers", "players"."loss_items", "players"."premend", "players"."online", "players"."marriage", "players"."promotion", "players"."deleted", "players"."description", "players"."create_ip", "players"."create_date", "players"."comment", "players"."hide_char", "accounts"."flag" FROM "players", "accounts" WHERE "players"."account_id" = "accounts"."id" AND "players"."world_id" = '0' AND "players"."group_id" != '4' AND "players"."group_id" != '5' AND "players"."group_id" != '6' AND "players"."account_id" != '1' ORDER BY "experience" DESC LIMIT 100
SQLSTATE:	00000
Driver code:	
Error message:

pokemon trainer items are not working-show for e.x carlin sword but i think i have to change something in options (try it later cant now)

when doing character shows something like:
Code:
(Please enter your new account name)
Name status:	
Query:	SELECT "id", "name", "password", "premdays", "lastday", "email", "key", "group_id", "create_ip", "create_date", "premium_points", "page_access", "location", "rlname", "email_new", "email_new_time", "email_code", "next_email", "last_post", "flag" FROM "accounts" WHERE "name" = 'TEST'
SQLSTATE:	00000
Driver code:	
Error message:	
Good account name ( TEST ). You can create account.


character which i done doesnt appear, why?
 
Last edited:
Better install XAMPP or Uniserver and use MySQL + phpmyadmin to manage database.

EDIT:

it works, thanks alot, i stayed in sqlite database, but if mysql changes something or its better tell me, please

first post at website its:
Code:
Query:	SELECT "g"."id" AS "id", "g"."name" AS "name", 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 "g"."id" > 0 AND "k"."unjustified" = 1 AND "k"."final_hit" = 1 GROUP BY "name" ORDER BY "frags" DESC, "name" ASC LIMIT 4;
SQLSTATE:	00000
Driver code:	
Error message:	
Query:	SELECT "players"."name", "z_forum"."post_text", "z_forum"."post_topic", "z_forum"."post_smile", "z_forum"."id", "z_forum"."replies", "z_forum"."post_date" FROM "players", "z_forum" WHERE "players"."id" = "z_forum"."author_guid" AND "z_forum"."section" = 1 AND "z_forum"."first_post" = "z_forum"."id" ORDER BY "z_forum"."last_post" DESC LIMIT 6
SQLSTATE:	00000
Driver code:	
Error message:

for e.x after highscores there are:
Code:
Query:	SELECT "players"."id", "players"."name", "players"."world_id", "players"."group_id", "players"."account_id", "players"."level", "players"."vocation", "players"."health", "players"."healthmax", "players"."experience", "players"."lookbody", "players"."lookfeet", "players"."lookhead", "players"."looklegs", "players"."looktype", "players"."lookaddons", "players"."maglevel", "players"."mana", "players"."manamax", "players"."manaspent", "players"."soul", "players"."town_id", "players"."posx", "players"."posy", "players"."posz", "players"."conditions", "players"."cap", "players"."sex", "players"."lastlogin", "players"."lastip", "players"."save", "players"."skull", "players"."skulltime", "players"."rank_id", "players"."guildnick", "players"."lastlogout", "players"."blessings", "players"."balance", "players"."stamina", "players"."direction", "players"."loss_experience", "players"."loss_mana", "players"."loss_skills", "players"."loss_containers", "players"."loss_items", "players"."premend", "players"."online", "players"."marriage", "players"."promotion", "players"."deleted", "players"."description", "players"."create_ip", "players"."create_date", "players"."comment", "players"."hide_char", "accounts"."flag" FROM "players", "accounts" WHERE "players"."account_id" = "accounts"."id" AND "players"."world_id" = '0' AND "players"."group_id" != '4' AND "players"."group_id" != '5' AND "players"."group_id" != '6' AND "players"."account_id" != '1' ORDER BY "experience" DESC LIMIT 100
SQLSTATE:	00000
Driver code:	
Error message:

pokemon trainer items are not working-show for e.x carlin sword but i think i have to change something in options (try it later cant now)

when doing character shows something like:
Code:
(Please enter your new account name)
Name status:	
Query:	SELECT "id", "name", "password", "premdays", "lastday", "email", "key", "group_id", "create_ip", "create_date", "premium_points", "page_access", "location", "rlname", "email_new", "email_new_time", "email_code", "next_email", "last_post", "flag" FROM "accounts" WHERE "name" = 'TEST'
SQLSTATE:	00000
Driver code:	
Error message:	
Good account name ( TEST ). You can create account.


character which i done doesnt appear, why?
1. Characters from account '1' are hidden in acc. maker.
2. Edit index.php and change DEBUG_DATABASE to false to remove these messages.
 
i instaled xampp but when i try to change mysql at my config.lua i have error when i try to go into accmaker:
Code:
Error occured!

Error ID: 
More info: CANNOT CONNECT TO DATABASE: SQLSTATE[HY000] [1130] Host 'Kapka-Komputer' is not allowed to connect to this MySQL server

File: C:\xampp\htdocs\classes/database_mysql.php   Line: 22
File: C:\xampp\htdocs\classes/database.php   Line: 220
File: C:\xampp\htdocs\classes/account.php   Line: 27
File: C:\xampp\htdocs\classes/account.php   Line: 43
File: C:\xampp\htdocs\classes/visitor.php   Line: 39
File: C:\xampp\htdocs\classes/visitor.php   Line: 30
File: C:\xampp\htdocs\classes/visitor.php   Line: 67
File: C:\xampp\htdocs\system/load.compat.php   Line: 38
File: C:\xampp\htdocs/index.php   Line: 33

this errors disapper when i reinstaled acc maker, but still have error when i try to instal acc with mysql

Tryied install acc maker when i set 'mysql' in config.lua but i have error in step2:
Code:
STEP 2

Check database connection
If you don't see any errors press link to STEP 3 - Add tables and columns to DB. If you see some errors it mean server has wrong configuration. Check FAQ or ask author of acc. maker.
Error occured!

Error ID: 
More info: CANNOT CONNECT TO DATABASE: SQLSTATE[HY000] [1130] Host 'Kapka-Komputer' is not allowed to connect to this MySQL server

File: C:\xampp\htdocs\classes/database_mysql.php   Line: 22
File: C:\xampp\htdocs/install.php   Line: 271
can go to set 3 but then have:
Code:
STEP 3

Add tables and columns to DB
Installer try to add new tables and columns to database.
Error occured!

Error ID: 
More info: CANNOT CONNECT TO DATABASE: SQLSTATE[HY000] [1130] Host 'Kapka-Komputer' is not allowed to connect to this MySQL server

File: C:\xampp\htdocs\classes/database_mysql.php   Line: 22
File: C:\xampp\htdocs\classes/database.php   Line: 199
File: C:\xampp\htdocs/install.php   Line: 451


EDIT:

im to fast, i done it i think ^^

tomorow i will think how to import my .spr and dat files to acc maker to show real players items, and configurate shop :)
 
Last edited:
I get this error, followed all your instuctions
what can i do?

Code:
Add samples to DB:
Query:    SELECT `id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `create_ip`, `create_date`, `comment`, `hide_char`, `signature` FROM `players` WHERE `name` = 'Account Manager'
SQLSTATE:    42S02
Driver code:    1146
Error message:    Table 'mysql.players' doesn't exist

Fatal error: Call to a member function fetch() on a non-object in C:\xampp\htdocs\classes\player.php on line 36
 
If it appear while installation then edit install.php find line (221):
PHP:
$SQL = Website::getDBHandle();
and under it paste:
PHP:
Website::getDBHandle()->setPrintQueries(true);
Then try to open bugged site again.

We are talking about acc. maker, not TFS and it's for 0.3.6.
Post automatically merged:

Better install XAMPP or Uniserver and use MySQL + phpmyadmin to manage database.

EDIT:


1. Characters from account '1' are hidden in acc. maker.

2. Edit index.php and change DEBUG_DATABASE to false to remove these messages.
how i skip this problem
 

Attachments

Back
Top