The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Query Help: Select users who are members of X group
I am coding a small app for a client that will allow them to edit certain added fields to the users table. What I am needing is to return all users who are a member of usergroup X (BOTH Primary and Additional Usergroups need to be checked for X).
I know you can do this with a vB function to check if the current logged in user is a member of a group like: PHP Code:
I am needing some SQL like: SELECT * FROM user WHERE usergroupid = '$level_to_check' OR membergroupids "contains $level_to_check" The "contains $level_to_check" part is where I am stuck as membergroupids contains data like "4,7,12" and I do not know how to efficiently check for a certain value with data stored in that format. HELP! Thank you...This is driving me crazy. -Steve |
#2
|
||||
|
||||
Look up the mysql FIND_IN_SET() function.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|