sandnes
Member
I need to solve a problem and am hoping for some help here...
A1. My forum has a 1-year-duration user upgrade for people who donate, and triggering the upgrade adds them to a special 'additional user group' as you would expect, and it removes them from the additional user group upon expiration, also as you would expect. So far, so good.
A2. I have a few things programmatically tied to the user's primary user group. So, what I need is an action or task that can ALSO, when members upgrade, change their primary user group. Also to change it back when the upgrade expires.
That's my main issue. If anyone can help me with a couple of one-time SQL queries as described below, that would be great too. It's related...
B1. I want to execute a query that will sync all my members' user groups, because I've been changing them manually and they don't get reset that way.
Something like this: if a member is has group 12 as an additional user group, AND their primary user group is group 2 (only), change their primary user group to 12. (The AND is important.)
B2. Also need an SQL query for basically the opposite: if a member's primary user group is 12 but they don't have 12 as an additional user group, then change their primary user group to 2.
I'm not good with SQL which is why I need assistance with these.
Thank you...
A1. My forum has a 1-year-duration user upgrade for people who donate, and triggering the upgrade adds them to a special 'additional user group' as you would expect, and it removes them from the additional user group upon expiration, also as you would expect. So far, so good.
A2. I have a few things programmatically tied to the user's primary user group. So, what I need is an action or task that can ALSO, when members upgrade, change their primary user group. Also to change it back when the upgrade expires.
That's my main issue. If anyone can help me with a couple of one-time SQL queries as described below, that would be great too. It's related...
B1. I want to execute a query that will sync all my members' user groups, because I've been changing them manually and they don't get reset that way.
Something like this: if a member is has group 12 as an additional user group, AND their primary user group is group 2 (only), change their primary user group to 12. (The AND is important.)
B2. Also need an SQL query for basically the opposite: if a member's primary user group is 12 but they don't have 12 as an additional user group, then change their primary user group to 2.
I'm not good with SQL which is why I need assistance with these.
Thank you...