The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I want to select a list of users that have a certain membergroupid
Code:
SELECT username FROM vb_user WHERE membergroupids = '9' LIMIT 0 , 30 So how can I make sure I also select those with multiple usergroups? --------------- Added [DATE]1201523929[/DATE] at [TIME]1201523929[/TIME] --------------- @the one that posted a reply earlier: This selects it only if the membergroupids start with 5. But it helped me, I've added everyone to the registered members group, and expanded it to WHERE membergroupids IN (2 , 5 , 7 ) Thank you. |
#2
|
||||
|
||||
![]()
That still isn't going to help you when the membergroupids is more than one. The mysql function you want is find_in_set
[mysql] select username from user where find_in_set('9',membergroupids) [/mysql] The main issue is this query is in no way optimised to use indices, and will do a full table scan. |
#3
|
|||
|
|||
![]()
What is the difference between find_in_set and this:
Code:
SELECT username FROM vb_user WHERE membergroupids LIKE '%9%' LIMIT 0, 30 |
#4
|
|||
|
|||
![]()
You are going to get 29, 92, etc.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|