2007-02-12, 03:26 AM
2007-02-12, 04:52 AM
Moved to code modifications as this does not qualify for general support.
2007-02-12, 05:10 AM
UPDATE
I believe that's your query.
mybb_users
SET mybb_usergroup
= "x" where postcount >= "y";I believe that's your query.
2007-02-12, 09:45 AM
Quote:A query that updates members in X group with x post count to y post count. Can someone help me?
I guess you mean people with Y post count to Group X ? Or Update the people of Group X with X Posts to Group Y with Y posts?
Clarify please... before we give you any code.
regards
2007-02-13, 03:14 PM
yes I believe the statement actually is
where
x=the GroupID of the TARGET USERGROUP
y= the number of posts that is the limit
z= the GroupID of the USERGROUP from where the users are to be moved
Note that this will only move those people who have the group Z as their primary group and will not touch those that have the group X as a secondary group...
for that...the code would be something like (NOT TESTED)
just a word of caution...
cheers,
Kimmo
UPDATE `mybb_users` SET `usergroup` = "x" where `postcount` >= "y" and `usergroup` = "z";
where
x=the GroupID of the TARGET USERGROUP
y= the number of posts that is the limit
z= the GroupID of the USERGROUP from where the users are to be moved
Note that this will only move those people who have the group Z as their primary group and will not touch those that have the group X as a secondary group...
for that...the code would be something like (NOT TESTED)
UPDATE `mybb_users` SET `usergroup` = "x" where postcount >= "y" and `usergroup` = "z" and instr(`additionalgroups`, `x`) >0;
although this would make people that have Z only as an additional group suddenly change their primary group to X....just a word of caution...
cheers,
Kimmo
2007-02-13, 07:28 PM
Kimmo that's not enough.. he needs something automatic im waiting until he clears his idea
2007-02-13, 10:34 PM
zaher1988 Wrote:Kimmo that's not enough.. he needs something automatic im waiting until he clears his idea
automatic? didn't say so in the original request...but oh well...
2007-02-13, 10:52 PM
He didn't say anything about automatic
2007-02-13, 10:56 PM
Hmm it is a common sense guys
2007-02-14, 12:23 PM
I do often mini-massupdates in phpmyadmin or with the dbase admin-tools in MyBB, because I lack the experience of writing up a tool that would do it automatically
as a matter of fact, I've written multiple simple-queries like this that are called by opening a certain page..this will set a flag against a number of records based on pre-set criteria...this flag is then utilized in some other utility of mine (mass email). I do not need it automatic...or actually I don't even want it automatic.
cheers,
kimmo
as a matter of fact, I've written multiple simple-queries like this that are called by opening a certain page..this will set a flag against a number of records based on pre-set criteria...this flag is then utilized in some other utility of mine (mass email). I do not need it automatic...or actually I don't even want it automatic.
cheers,
kimmo