Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Jun 2011, 00:06
SnakeEaterITA SnakeEaterITA is offline
 
Join Date: Jul 2010
SQL Query to get list of all users

Hi there,

I need to create a list of all users that belong to a certain usergrup, in order to make a comma-separated list.

I found this, but it doesn't seem to work: http://www.vbulletin.org/forum/showthread.php?t=256215

any idea?
Reply With Quote
  #2  
Old 22 Jun 2011, 00:14
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
in phpmyadmin run the SQL Query:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Make sure you add your table prefix to "user" if you have one.

2 is the registered users usergroup, change it to whatever usergroup you want.

ORDER BY username will make it alphabetical... change it to ORDER BY userid if you prefer the order in which they joined.

In phpmyadmin there is an option to export your results as a csv file.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #3  
Old 22 Jun 2011, 09:39
SnakeEaterITA SnakeEaterITA is offline
 
Join Date: Jul 2010
Cool, thanks. but i just noticed YAAS doesn't support multi-user selection. I want to assign an award to all the users of the usergroup 2

the tables i have to work on are award_user.award_id and award_user.userid

the thing i want to reproduce is:


SELECT userid FROM user WHERE usergroupid = 2 AND PUT THE userid INTO award_user.userid ASSOCIATED WITH award_user.award_id = 14

(i have to give the award 14 to all the users of the group 2)

any idea?

thanks a lot!


EDIT: ok i managed to insert the userid, but now they show 0 in the award_id column. I have to change all the 0 to 14


INSERT INTO award_user(award_id)
VALUES (16) WHERE award_id=0

is not working

EDIT 2: ok, I had to use the UPDATE function!

Last edited by SnakeEaterITA; 22 Jun 2011 at 10:10.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 12:46.

Layout Options | Width: Wide Color: