A small MYSQL storing/retrieving data based command. How?
#2

This is of how I thought of this:

- Main table factions with 2 columns: factionid (PRIMARY KEY and auto increment) and leader (default value 0).
- Child table factions_members with 2 columns: factionid (references to factions.factionid so if a faction is deleted from main table, all its members will be removed from this table as well) and userid (upon registering a unique ID for each player - references to players.userid).

For the query in /factions, you can use JOIN to get the player's name of the leader and COUNT for the total (rows) members of each faction.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)