Well I dont think you fully understand or tried my query.
Code:
SELECT
cq_syndicate.NAME,cq_syndicate.money,cq_user.name
FROM
cq_syndicate,cq_synattr,cq_user
WHERE
cq_syndicate.id = cq_synattr.syn_id
AND
cq_synattr.rank >= 900
AND
cq_synattr.id = cq_user.id
ORDER BY
cq_syndicate.money
DESC LIMIT 100
The output for acme database is like so
Code:
Legion Name - Legion Gold - Player Name
----------------------------------------
Death_Knights-66614767114-DEMONKILLER6969
Death_Knights-66614767114-Joshua
Death_Knights-66614767114-Lord_Pain
Death_Knights-66614767114-DeathsMistress
Death_Knights-66614767114-Squeeky
Death_Knights-66614767114-death-to-all
Death_Knights-66614767114-Murder-Me-16
Gr34T_SouL-63355847661-~*Al-prince*~
Gr34T_SouL-63355847661-+_MAILED_+
Gr34T_SouL-63355847661-AdzorpTion
Gr34T_SouL-63355847661-_LorD_
Gr34T_SouL-63355847661-~kræM~
~*We*R*JustiCe*-61030391618-###zoom###
~*We*R*JustiCe*-61030391618-*~ELAMER~*
~*We*R*JustiCe*-61030391618-FalCon
~*We*R*JustiCe*-61030391618-*&Dark&Hell&*
~*We*R*JustiCe*-61030391618-BeBoo
~*We*R*JustiCe*-61030391618-Elcomanda
~*We*R*JustiCe*-61030391618-*MaTReX*
.:!All-$tars!:.-57994688979-mtirx
.:!All-$tars!:.-57994688979-elzaem
.:!All-$tars!:.-57994688979-H.....A...AHMED
.:!All-$tars!:.-57994688979-necroshear
.:!All-$tars!:.-57994688979-Motherm
.:!All-$tars!:.-57994688979-***JM***
.:!All-$tars!:.-57994688979-spiderman2008
The_Masters-48282621125-kate.
The_Masters-48282621125-asklepius
The_Masters-48282621125-ZARATOR
The_Masters-48282621125-Kushumai
The_Masters-48282621125-l_Un4GiveN_l
The_Masters-48282621125-MEGUMI
The_Masters-48282621125-#24marley#24
HeartlessAngels-45567097486-~DeaTh~ScorpIon
HeartlessAngels-45567097486-~Fire*Man~
HeartlessAngels-45567097486-#90Andy#90
HeartlessAngels-45567097486-Tsubasa.
HeartlessAngels-45567097486-RavensAngel
The|Al|Che|Mist-45338446403-SARAY_SOYOP
The|Al|Che|Mist-45338446403-cristina
The|Al|Che|Mist-45338446403-IchigoBL
The|Al|Che|Mist-45338446403-3565413.1897
JuSt`CaVaLLi-44472622720-JuSt`CaVaLLi
JuSt`CaVaLLi-44472622720-~NOVA~
JuSt`CaVaLLi-44472622720-Sat-Thu
JuSt`CaVaLLi-44472622720-NightWalKer
JuSt`CaVaLLi-44472622720-neoplanet
JuSt`CaVaLLi-44472622720-zhai
Dark*Empire-43977705029-WarStar
Dark*Empire-43977705029-NarutoOFTheLeaf
Dark*Empire-43977705029-daRk^KiNgpLar
Dark*Empire-43977705029-hazzer
Dark*Empire-43977705029-masterlink
Dark*Empire-43977705029-Hell_Enma#71
Dark*Empire-43977705029-Pro_Mage
AtrumDeus-42621409603-Cagney
AtrumDeus-42621409603-.Gunner.
AtrumDeus-42621409603-Br0KeN~HeArT
AtrumDeus-42621409603-JechT
AtrumDeus-42621409603-jay
AtrumDeus-42621409603-memaloca
AtrumDeus-42621409603-.:NeutraL:.
Smith|Warrior-41006617958-*°::.Lobão.::°*
Smith|Warrior-41006617958-Secret_Love
Smith|Warrior-41006617958-Duplex_s2
Smith|Warrior-41006617958-sakura
Smith|Warrior-41006617958-lucifer_S2
Smith|Warrior-41006617958-Witch<OF>Hill
~.:Steels:.~-39840251839-Jensen94
~.:Steels:.~-39840251839-Mcoy2x
~.:Steels:.~-39840251839-SAIFE
~.:Steels:.~-39840251839-aaron99
UnholY__KnightS-36960822825-~Joan*Of*Arc~
UnholY__KnightS-36960822825-.:|_Mordrid_|:.
UnholY__KnightS-36960822825-~MERLIN~
UnholY__KnightS-36960822825-Tapitsgabs
UnholY__KnightS-36960822825-tapit_420
Rebles_Of_Love~-36292197935-hoop
Rebles_Of_Love~-36292197935--SeRiNiTy-
Rebles_Of_Love~-36292197935-hellrazor
Rebles_Of_Love~-36292197935-N0T~CHiiLDiiSH
Rebles_Of_Love~-36292197935-hellboy
Rebles_Of_Love~-36292197935-Banana
~*SuPeRnOvA*~-34311225287-)~(FLaRe)~(
~*SuPeRnOvA*~-34311225287-Justinbebustin
~*SuPeRnOvA*~-34311225287-~*Rogeris*~
~*SuPeRnOvA*~-34311225287--|chio_ram|-
~*SuPeRnOvA*~-34311225287-~~Cloud~~
~*SuPeRnOvA*~-34311225287--|ScottBakula|-
Alchemist-33441116016-TyrionLannister
Alchemist-33441116016-sweethoney
Alchemist-33441116016-King_Dragon
Alchemist-33441116016-Mr.Andrew
Alchemist-33441116016-Brandivio
Nicafe_Idiots!-31555358530-gago_ka?
^-^SpartanI^-^-30087091970-~Dan~
^-^SpartanI^-^-30087091970-*Dany*SMK*
Ar|a_51-29098259413-Plagu3
Ar|a_51-29098259413-killer_girl
Ar|a_51-29098259413-MooM
Now if you wanted to display the ranks of these guys you would have another table
Name: legion_rank_name
Design:
Code:
rank_number - rank_name
---------------------------
1000 - Leader
990 - Deputy
980 - HonorDeputy
920 - Leader'sSpouse
900 - 6-star
890 - General
880 - HonorGeneral
850 - Captain
840 - HonorCaptain
690 - Lieutenant
680 - HonorLieut.
620 - Deputy'sSpouse
611 - Deputy'sAide
610 - LeadSpouseAide
603 - Secretary
602 - LeaderSecretary
600 - 3-star
590 - Sergeant
521 - Captain'sSpouse
520 - General'sSpouse
511 - Captain'sAide
510 - General'sAide
500 - 2-star
490 - SeniorMember
420 - Lieut.'sSpouse
400 - 1-star
240 - Level1Member
230 - Level2Member
220 - Level3Member
201 - JuniorMember
200 - CommonMember
100 - Reservist
then you would change the above sql query to look like this to display legion rank next to their name
Code:
SELECT
cq_syndicate.NAME,
cq_syndicate.money,
cq_user.name,
legion_rank_name.rank_name
FROM
cq_syndicate ,
cq_user ,
cq_synattr
Inner Join legion_rank_name ON cq_synattr.rank = legion_rank_name.rank_number
WHERE
cq_syndicate.id = cq_synattr.syn_id
AND
cq_synattr.rank >= 900
AND
cq_synattr.id = cq_user.id
ORDER BY
cq_syndicate.money DESC,
cq_synattr.rank DESC
LIMIT 100
and if you don't feel like making the table run this SQL code to create the table needed, I can assure you this works fine
Code:
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `legion_rank_name`;
CREATE TABLE `legion_rank_name` (
`rank_number` int(4) NOT NULL default '0',
`rank_name` char(50) default NULL,
PRIMARY KEY (`rank_number`)
) TYPE=MyISAM;
INSERT INTO `legion_rank_name` VALUES ('1000', 'Leader'),
('990', 'Deputy'),
('980', 'HonorDeputy'),
('920', 'Leader\'sSpouse'),
('900', '6-star'),
('890', 'General'),
('880', 'HonorGeneral'),
('850', 'Captain'),
('840', 'HonorCaptain'),
('690', 'Lieutenant'),
('680', 'HonorLieut.'),
('620', 'Deputy\'sSpouse'),
('611', 'Deputy\'sAide'),
('610', 'LeadSpouseAide'),
('603', 'Secretary'),
('602', 'LeaderSecretary'),
('600', '3-star'),
('590', 'Sergeant'),
('521', 'Captain\'sSpouse'),
('520', 'General\'sSpouse'),
('511', 'Captain\'sAide'),
('510', 'General\'sAide'),
('500', '2-star'),
('490', 'SeniorMember'),
('420', 'Lieut.\'sSpouse'),
('400', '1-star'),
('240', 'Level1Member'),
('230', 'Level2Member'),
('220', 'Level3Member'),
('201', 'JuniorMember'),
('200', 'CommonMember'),
('100', 'Reservist'),
('4', '0-star'),
('3', '4-star'),
('2', '5-star'),
('1', '7-star');
finaly the result of the new query with the new table is as follows for acme
Code:
Legion Name Total Gold Member Name Member Rank
===========================================================================
Death_Knights 66614767114 Murder-Me-16 Leader
Death_Knights 66614767114 death-to-all Deputy
Death_Knights 66614767114 DEMONKILLER6969 Deputy
Death_Knights 66614767114 Joshua Deputy
Death_Knights 66614767114 Squeeky Deputy
Death_Knights 66614767114 Lord_Pain HonorDeputy
Death_Knights 66614767114 DeathsMistress HonorDeputy
Gr34T_SouL 63355847661 +_MAILED_+ Leader
Gr34T_SouL 63355847661 _LorD_ Deputy
Gr34T_SouL 63355847661 ~kræM~ Deputy
Gr34T_SouL 63355847661 AdzorpTion HonorDeputy
Gr34T_SouL 63355847661 ~*Al-prince*~ HonorDeputy
~*We*R*JustiCe* 61030391618 FalCon Leader
~*We*R*JustiCe* 61030391618 *MaTReX* Deputy
~*We*R*JustiCe* 61030391618 ###zoom### Deputy
~*We*R*JustiCe* 61030391618 *&Dark&Hell&* Deputy
~*We*R*JustiCe* 61030391618 *~ELAMER~* Deputy
~*We*R*JustiCe* 61030391618 BeBoo HonorDeputy
.:!All-$tars!:. 57994688979 elzaem Leader
.:!All-$tars!:. 57994688979 H.....A...AHMED Deputy
.:!All-$tars!:. 57994688979 ***JM*** Deputy
.:!All-$tars!:. 57994688979 mtirx Deputy
.:!All-$tars!:. 57994688979 necroshear Deputy
.:!All-$tars!:. 57994688979 spiderman2008 HonorDeputy
.:!All-$tars!:. 57994688979 Motherm HonorDeputy
The_Masters 48282611125 asklepius Leader
The_Masters 48282611125 MEGUMI Deputy
The_Masters 48282611125 kate. Deputy
The_Masters 48282611125 Kushumai Deputy
The_Masters 48282611125 #24marley#24 Deputy
The_Masters 48282611125 l_Un4GiveN_l HonorDeputy
The_Masters 48282611125 ZARATOR HonorDeputy
HeartlessAngels 45567097486 Tsubasa. Leader
HeartlessAngels 45567097486 ~Fire*Man~ Deputy
HeartlessAngels 45567097486 RavensAngel Deputy
HeartlessAngels 45567097486 ~DeaTh~ScorpIon Deputy
HeartlessAngels 45567097486 #90Andy#90 HonorDeputy
The|Al|Che|Mist 45338446403 IchigoBL Leader
The|Al|Che|Mist 45338446403 SARAY_SOYOP Deputy
The|Al|Che|Mist 45338446403 3565413.1897 Deputy
The|Al|Che|Mist 45338446403 cristina HonorDeputy
JuSt`CaVaLLi 44472622720 ~NOVA~ Leader
JuSt`CaVaLLi 44472622720 NightWalKer Deputy
JuSt`CaVaLLi 44472622720 neoplanet Deputy
JuSt`CaVaLLi 44472622720 Sat-Thu Deputy
JuSt`CaVaLLi 44472622720 JuSt`CaVaLLi Deputy
JuSt`CaVaLLi 44472622720 zhai HonorDeputy
Dark*Empire 43977705029 masterlink Leader
Dark*Empire 43977705029 daRk^KiNgpLar Deputy
Dark*Empire 43977705029 hazzer Deputy
Dark*Empire 43977705029 Pro_Mage Deputy
Dark*Empire 43977705029 NarutoOFTheLeaf Deputy
Dark*Empire 43977705029 Hell_Enma#71 HonorDeputy
Dark*Empire 43977705029 WarStar HonorDeputy
AtrumDeus 42621409603 Cagney Leader
AtrumDeus 42621409603 Br0KeN~HeArT Deputy
AtrumDeus 42621409603 JechT Deputy
AtrumDeus 42621409603 .:NeutraL:. Deputy
AtrumDeus 42621409603 jay Deputy
AtrumDeus 42621409603 memaloca HonorDeputy
AtrumDeus 42621409603 .Gunner. HonorDeputy
Smith|Warrior 41006617958 Secret_Love Leader
Smith|Warrior 41006617958 *°::.Lobão.::°* Deputy
Smith|Warrior 41006617958 sakura Deputy
Smith|Warrior 41006617958 lucifer_S2 Deputy
Smith|Warrior 41006617958 Duplex_s2 HonorDeputy
Smith|Warrior 41006617958 Witch<OF>Hill HonorDeputy
~.:Steels:.~ 39840251839 Jensen94 Leader
~.:Steels:.~ 39840251839 aaron99 Deputy
~.:Steels:.~ 39840251839 Mcoy2x Deputy
~.:Steels:.~ 39840251839 SAIFE HonorDeputy
UnholY__KnightS 36960822825 .:|_Mordrid_|:. Leader
UnholY__KnightS 36960822825 ~MERLIN~ Deputy
UnholY__KnightS 36960822825 ~Joan*Of*Arc~ Deputy
UnholY__KnightS 36960822825 Tapitsgabs Deputy
UnholY__KnightS 36960822825 tapit_420 HonorDeputy
Rebles_Of_Love~ 36292197935 hoop Leader
Rebles_Of_Love~ 36292197935 hellboy Deputy
Rebles_Of_Love~ 36292197935 Banana Deputy
Rebles_Of_Love~ 36292197935 N0T~CHiiLDiiSH Deputy
Rebles_Of_Love~ 36292197935 -SeRiNiTy- HonorDeputy
Rebles_Of_Love~ 36292197935 hellrazor HonorDeputy
~*SuPeRnOvA*~ 34691175287 )~(FLaRe)~( Leader
~*SuPeRnOvA*~ 34691175287 Justinbebustin Deputy
~*SuPeRnOvA*~ 34691175287 ~~Cloud~~ Deputy
~*SuPeRnOvA*~ 34691175287 ~*Rogeris*~ Deputy
~*SuPeRnOvA*~ 34691175287 -|chio_ram|- Deputy
~*SuPeRnOvA*~ 34691175287 -|ScottBakula|- HonorDeputy
Alchemist 33441116016 sweethoney Leader
Alchemist 33441116016 Brandivio Deputy
Alchemist 33441116016 King_Dragon Deputy
Alchemist 33441116016 TyrionLannister Deputy
Alchemist 33441116016 Mr.Andrew HonorDeputy
Nicafe_Idiots! 31555358530 gago_ka? Leader
^-^SpartanI^-^ 30087091970 *Dany*SMK* Leader
^-^SpartanI^-^ 30087091970 ~Dan~ Deputy
Ar|a_51 29098259413 D3athKn|ght Leader
Ar|a_51 29098259413 Plagu3 Deputy
Ar|a_51 29098259413 killer_girl Deputy
Ar|a_51 29098259413 DangeR Deputy