Getting UIDs of Additional Usergroups
#1
Question 
I'm trying to get all the uids that belong to a particular usergroup which is fine if it's the user's primary usergroup but I'm having trouble matching their additional usergroups.

Can anyone provide some insight on how to get a list of uids using a gid including those users which have that group listed as an additional group?

Much appreciated.
Reply
#2
Use the concat function in mySQL to query in additional usergroups:

SELECT * FROM mybb_users
WHERE CONCAT(',',additionalgroups,',') LIKE '%,".$fid.",%'

Will list all users that have $fid listed as an additional group.
Reply
#3
Thanks a lot man, figured it out like 30 mins before I saw this. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)