View Single Post
Old 03/12/2019, 02:08 PM   #8
Calisthenics
High-roller
 
Join Date: May 2018
Posts: 1,228
Reputation: 205
Default Re: Fetch offline and online players

If you decide to use MySQL and use the table structures Kwarde suggested (which is the correct way to have members in a separate table), I would like to note two things.

1) `Owner` can be foreign key for target users(ID) instead of a VARCHAR column.
2) A simple JOIN is enough to get the members of a certain faction ID:
pawn Code:
SELECT Name AS User_Name
  FROM faction_members
  JOIN users u
    ON u.ID=`Member`
 WHERE faction_id=1;
Member is reserved keyword, this is why it is wrapped around in backticks.
Calisthenics is offline   Reply With Quote