Log in

View Full Version : Database query to list all users within usergroup?


Ua|Eight
03-23-2014, 01:47 PM
If I wanted to export a list of users in usergroup id = 44, how would I go about that?

ForceHSS
03-23-2014, 02:30 PM
Export them to where?

ozzy47
03-23-2014, 03:11 PM
You can do that from phpmyadmin within your cpanel, by running this query:

SELECT * FROM user
WHERE usergroupid = 44

You can then export the list from there.

Simon Lloyd
03-23-2014, 05:51 PM
You can do that from phpmyadmin within your cpanel, by running this query:

SELECT * FROM user
WHERE usergroupid = 44

You can then export the list from there.You can run that directly in admincp>maintainance>execute sql query and you'll get a list :) (don't forget to add any table prefix you use before "user" so maybe you use vb as the prefix and it would look like this

SELECT * FROM vb_user
WHERE usergroupid = 44

ozzy47
03-23-2014, 05:52 PM
You can run that directly in admincp>maintainance>execute sql query and you'll get a list :) (don't forget to add any table prefix you use before "user" so maybe you use vb as the prefix and it would look like this

SELECT * FROM vb_user
WHERE usergroupid = 44

Right, but he won't be able to export it as he asked in the OP. :)

Simon Lloyd
03-23-2014, 05:57 PM
Doh, should read more carefully :D

ozzy47
03-23-2014, 05:58 PM
It happens to all of us at some point. :)

Simon Lloyd
03-23-2014, 06:06 PM
This should help you export the results to csv http://www.tech-recipes.com/rx/1475/save-mysql-query-results-into-a-text-or-csv-file/