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

MySQL error on login

GhostWD

I'm in love with the var_dump()
Joined
Jan 25, 2009
Messages
185
Solutions
6
Reaction score
29
Hi there! I've got problem when connecting to server it throws this error.

Code:
SELECT `pk`.`player_id`, `pd`.`date` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` WHERE `pd`.`player_id` = 7530 AND `k`.`unjustified` = 1 AND `pd`.`date` >= 1515784313 AND `k`.`war` = 0 - MYSQL ERROR: Unknown column 'pd.id' in 'on clause' (1054)

Thanks in advance.
 
Solution
So, there's no column named id, right? Maybe you should try creating an id column.
Code:
ALTER TABLE `player_deaths` ADD `id` INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);
I'm connected and I can login on account and char but when i login (connect) on char it prints that error in console
 
Do you have the player_deaths table on your database? Also, could you post the globalevents/init.lua or globalevents/start.lua?​
 
@Nihilist yep table is in db with columns player_id,date,level

and i haven't got init.lua only start
Code:
function onStartup()
   db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
   return true
end

btw. it's TFS 0.4
 
So, there's no column named id, right? Maybe you should try creating an id column.
Code:
ALTER TABLE `player_deaths` ADD `id` INT(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`);
 
Solution
yep its working right now i thought that 'id' column is not present in 'player_deaths' table by default but now i know that my server database update just erased it

Thanks nihilist
 
Back
Top