• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved SQL error

dunnish

New Member
Joined
Jun 18, 2009
Messages
277
Solutions
1
Reaction score
3
Hello guys!
im getting this error message.

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:    42S22
Driver code:    1054
Error message:    Unknown column 'players.loss_experience' in 'field list'

Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\classes\databaselist.php on line 68
 
1.2 doesn't have a column called loss_experience
See
PHP:
CREATE TABLE IF NOT EXISTS `players` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `group_id` int(11) NOT NULL DEFAULT '1',
  `account_id` int(11) NOT NULL DEFAULT '0',
  `level` int(11) NOT NULL DEFAULT '1',
  `vocation` int(11) NOT NULL DEFAULT '0',
  `health` int(11) NOT NULL DEFAULT '150',
  `healthmax` int(11) NOT NULL DEFAULT '150',
  `experience` bigint(20) NOT NULL DEFAULT '0',
  `lookbody` int(11) NOT NULL DEFAULT '0',
  `lookfeet` int(11) NOT NULL DEFAULT '0',
  `lookhead` int(11) NOT NULL DEFAULT '0',
  `looklegs` int(11) NOT NULL DEFAULT '0',
  `looktype` int(11) NOT NULL DEFAULT '136',
  `lookaddons` int(11) NOT NULL DEFAULT '0',
  `maglevel` int(11) NOT NULL DEFAULT '0',
  `mana` int(11) NOT NULL DEFAULT '0',
  `manamax` int(11) NOT NULL DEFAULT '0',
  `manaspent` int(11) unsigned NOT NULL DEFAULT '0',
  `soul` int(10) unsigned NOT NULL DEFAULT '0',
  `town_id` int(11) NOT NULL DEFAULT '0',
  `posx` int(11) NOT NULL DEFAULT '0',
  `posy` int(11) NOT NULL DEFAULT '0',
  `posz` int(11) NOT NULL DEFAULT '0',
  `conditions` blob NOT NULL,
  `cap` int(11) NOT NULL DEFAULT '0',
  `sex` int(11) NOT NULL DEFAULT '0',
  `lastlogin` bigint(20) unsigned NOT NULL DEFAULT '0',
  `lastip` int(10) unsigned NOT NULL DEFAULT '0',
  `save` tinyint(1) NOT NULL DEFAULT '1',
  `skull` tinyint(1) NOT NULL DEFAULT '0',
  `skulltime` int(11) NOT NULL DEFAULT '0',
  `lastlogout` bigint(20) unsigned NOT NULL DEFAULT '0',
  `blessings` tinyint(2) NOT NULL DEFAULT '0',
  `onlinetime` int(11) NOT NULL DEFAULT '0',
  `deletion` bigint(15) NOT NULL DEFAULT '0',
  `balance` bigint(20) unsigned NOT NULL DEFAULT '0',
  `offlinetraining_time` smallint(5) unsigned NOT NULL DEFAULT '43200',
  `offlinetraining_skill` int(11) NOT NULL DEFAULT '-1',
  `stamina` smallint(5) unsigned NOT NULL DEFAULT '2520',
  `skill_fist` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_fist_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_club` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_club_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_sword` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_sword_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_axe` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_axe_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_dist` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_dist_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_shielding` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_shielding_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  `skill_fishing` int(10) unsigned NOT NULL DEFAULT 10,
  `skill_fishing_tries` bigint(20) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  KEY `vocation` (`vocation`)
) ENGINE=InnoDB;

And this
PHP:
`players`.`world_id` = '0'
Should be this
PHP:
`players`.`world_id` == '0'
or this
PHP:
`players`.`world_id` >= '0'
PHP:
 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_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;
 
Back
Top