ATT3
Intermediate OT User
- Joined
- Sep 22, 2010
- Messages
- 512
- Reaction score
- 100
The problem itself sounds quite simple, but I just simply can't figure out.
I am trying to get information from two different tables and subtract some column from another column.
Currently that code doesn't return any numbers.
This far I've managed to;
1. Get information from players and znote_players tables. (done)
2. Compare the id's between each other (done)
3. Subtract (znote_players) 'player_lastexp' from (players) 'experience' (no success)
Anyone got any idea? - much appreciated.
https://github.com/Znote/ZnoteAAC/pull/155 (powergamers.php)
I am trying to get information from two different tables and subtract some column from another column.
Code:
$znotePlayers = mysql_select_multi("SELECT `a`.*, (`a`.`experience`+`b`.`exphist_lastexp`) AS `expdiff` FROM `players` `a` JOIN `znote_players` `b` ON `a`.`id` = `b`.`id` WHERE `a`.`group_id` < 2 ORDER BY `expdiff` DESC LIMIT ". $limit);
This far I've managed to;
1. Get information from players and znote_players tables. (done)
2. Compare the id's between each other (done)
3. Subtract (znote_players) 'player_lastexp' from (players) 'experience' (no success)
Anyone got any idea? - much appreciated.
https://github.com/Znote/ZnoteAAC/pull/155 (powergamers.php)