Announcement

Collapse
No announcement yet.

mass add all users to another usergroup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mass add all users to another usergroup

    I am looking for a way of mass adding all users to a secndary usergroup. The usergroup number is 12. I can do it in mysql if required just need to know the mysql command to do.

  • #2
    Secondary groupids are stored in a comma list, so they are hard to manipulate with a query.

    If none of the users belong to another secondary group, then this query should work:

    Code:
    UPDATE user
    SET membergroupids = X
    Otherwise try this:

    Code:
    UPDATE user
    SET membergroupids = CONCAT( '' , membergroupids , ',X' )
    Where X is the usergroupid of the new secondary group.

    I haven't tested this, so backup first and use with caution. Also, these queries do not check if the user is already a member of X.

    Hopefully that helps. I don't know of a more universal query for this.

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X