Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 9 Years, 9 Months, 2 Weeks ago Count Group Members
#1
Solved: 9 Years, 9 Months, 2 Weeks ago
This user has been denied support. This user has been denied support.
I'm currently in need of 4 variables. I want to display the total amount of members of individual groups on the AdminCP index page.
Like this on the group management page: http://i.gyazo.com/fd2880d65e7b3783682ca797f0c8b955.png

It should display the total amount of members. (Primary group and secondary group counted)

Need these variables:
$total_1 = TOTAL AMOUNT OF GROUP ID 12
$total_2 = TOTAL AMOUNT OF GROUP ID 28
$total_3 = TOTAL AMOUNT OF GROUP ID 36
$total_4 = TOTAL AMOUNT OF GROUP ID 12 + 28 + 36

Sorry for grammar, didn't sleep since 31 hours.
#2
Solved: 9 Years, 9 Months, 2 Weeks ago
You would need a plugin, but you would just have to do a simple query that does a select count() on the groups
#3
Solved: 9 Years, 9 Months, 2 Weeks ago
This user has been denied support. This user has been denied support.
$count = $db->fetch_field( $db->query( "SELECT COUNT(*) as numberofmembers FROM ".TABLE_PREFIX."users WHERE usergroup = {Usergroup} ), 'numberofmembers' );
#4
Solved: 9 Years, 9 Months, 2 Weeks ago
(2015-04-04, 07:21 AM)Cedric Wrote: $count = $db->fetch_field( $db->query( "SELECT COUNT(*) as numberofmembers FROM ".TABLE_PREFIX."users WHERE usergroup = {Usergroup} ), 'numberofmembers' );

The thread was posted on "06-12-2014, 07:47 AM"
#5
Solved: 9 Years, 9 Months, 2 Weeks ago
This user has been denied support. This user has been denied support.
(2015-04-04, 07:26 AM)PhantomD Wrote:
(2015-04-04, 07:21 AM)Cedric Wrote: $count = $db->fetch_field( $db->query( "SELECT COUNT(*) as numberofmembers FROM ".TABLE_PREFIX."users WHERE usergroup = {Usergroup} ), 'numberofmembers' );

The thread was posted on "06-12-2014, 07:47 AM"

And now it's solved. Cool
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)