Announcement

Collapse
No announcement yet.

SQL query for updating user.displaygroupid

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

  • SQL query for updating user.displaygroupid

    I need a query to update all members who belong to a certain usergroup (42) so that their displaygroupid = that usergroup (42).

    This works:
    Code:
    update user set displaygroupid = 42 where membergroupids = 42
    but it only checks the first group in the membergroupids field. If the member also belongs to other groups with lower ids, it doesnt work. Is there a way to loop through each member's membergroupids field for the match?

    Any help? Thanx.
    Last edited by knimrod; Sun 18 Sep '05, 12:13pm.

  • #2
    Nevermind... I figured it out. For those interested it's:
    Code:
    update user set displaygroupid = 42 where find_in_set(42, membergroupids)

    Comment

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