![]() |
Best way to retrieve the number of users with a specific secondary usergroup?
Is there any easy way to retrieve the amount of users who have a specific secondary usergroup? I need to be able to quickly retrieve a count, and want to know the most load-friendly way of doing it. (Without looping through the resultset to check if the groupid is in the array of membergroupids.)
Edit: for other people's reference here is how vbulletin does it: (I guess I'm all set.) Code:
// count secondary users |
If you just want to have the count for a specific secondary usergroup, the following query (untested!) should also work:
[sql]SELECT COUNT(*) FROM user WHERE FIND_IN_SET(GROUPID, membergroupids);[/sql]Replace GROUPID with the group you are searching for. |
All times are GMT. The time now is 07:08 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|