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

Lua Help with importing info from db

Gothric

New Member
Joined
Feb 6, 2010
Messages
264
Reaction score
1
I want to get player from db of the highest storage 666 and vocation 4

I dont know how to check vocation of players becouse column 'vocation' is in 'players' not in 'player_storage' xd srry for my english
but i think u know what i mean

i tried this

PHP:
c = db.getResult("SELECT `player_id`,`value` FROM `player_storage` WHERE `key` = '666' ORDER BY `value` DESC LIMIT 1;")

but as i said there isnt any variant of vocation ;<
it should look like this

PHP:
c = db.getResult("SELECT `player_id`,`value` FROM `player_storage` WHERE `key` = '666' AND `vocation` = 4 ORDER BY `value` DESC LIMIT 1;")

but there is error in console becouse column vocation is not in player_storage


help me .. rep++
 
SQL:
SELECT `p`.`id`, `ps`.`value` FROM `player_storage` AS `ps` LEFT JOIN `players` AS `p` ON `p`.`id` = `ps`.`player_id` WHERE `ps`.`key` = 666 AND `p`.`vocation` = 4 ORDER BY `ps`.`value` DESC LIMIT 1;
 
SQL:
SELECT `p`.`id`, `p`.`name`, `ps`.`value` FROM `player_storage` AS `ps` LEFT JOIN `players` AS `p` ON `p`.`id` = `ps`.`player_id` WHERE `ps`.`key` = 666 AND `p`.`vocation` = 4 ORDER BY `ps`.`value` DESC LIMIT 1;
 
Back
Top