MySQL showing total members in factions/online members.
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You'll want to use "group by". Bascially what you want to do is this:
PHP код:
SELECT factionidCOUNT(factionid) AS memberCount FROM Accounts GROUP BY factionid 
That will then produce a list of factionids and the number of rows for each. To add the name you need to join the other table. I'm not sure if the query below is entirely correct because I don't have a database to test it with.
PHP код:
SELECT a.factionidf.NameCOUNT(a.factionid) AS memberCount FROM Accounts a INNER JOIN Faction f ON f.ID a.factionid GROUP BY a.factionidf.Name 
Do I not need to use CallBack for that function mate? Because my inital goal is to loop through `factionid` in pawno. Similarly how I used CallBackFunction for my command /faction, which looked over at LoadFactionIG. Then I simply initiated and defined my rows and fields then I looped through. Could you please show me how to do it in python where, I can simply ShowPlayerDialog with respective faction name and total faction members on that one faction. I'm not too sure about pawno syntax where I could simply add one everyime I see the factionid being repeated under my `accounts` table field.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)