coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 permissions => Topic started by: stardust on January 19, 2009, 03:07:43 AM

Title: MySQL db - change all "user_group_list" from "0" to "#" instantly
Post by: stardust on January 19, 2009, 03:07:43 AM
I'm not familiar with the terminology on mysql db but I wonder if there is a query I can run, or just something I can do, to change all the "0" to "5" in the user_group_list part of cpg14x_users? I want them to change all at once.

I already set the Default to 5, but that looks like it is only for members who joined after I set that. And I don't want to manually go through each member because I have nearly 2000 Registered members in my gallery. There are a few members who are in different primary groups, as Mods or other staff kind of members. Group 5 is what I want checked on all Registered/different group members. So while group 5 isn't primary, I have albums assigned to it that I want only logged in users to see, without having to change their primary groups.

Please tell me there is some way to do this ???
Title: Re: MySQL db - change all "user_group_list" from "0" to "#" instantly
Post by: Nibbler on January 19, 2009, 01:59:16 PM
UPDATE cpg14x_users SET user_group_list = REPLACE(user_group_list, 0, 5);

Make a backup before running just in case.
Title: Re: MySQL db - change all "user_group_list" from "0" to "#" instantly
Post by: stardust on January 19, 2009, 06:13:05 PM
Excellent! Worked without a problem. Thanks, you saved me a lot of time!