Useful queries for mass-moving members > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

Useful queries for mass-moving members

wersja drukowalna wersja Microsoft Word wersja HTML

A common request is for a method to mass move members into a new group (for example: you have created and adjusted your member groups but now you have a lot of members in the wrong group and do not want to manually move them all)

This is easy to achieve via a query. :)

As always with running a query, if in doubt: Stop and ask advice before doing anything.


First, find out the ID of the member groups you wish to move.

Visit the SQL toolbox > ACP > Admin > SQL Management > SQL Toolbox > Scroll down to the manual query window (this is where you will be running any queries)

Run this one...

SELECT g_id, g_title FROM ibf_groups


That will provide you with a list of the group ID number and the name. Make a careful note of the ones you need.

Now I will provide a few of the most commonly requested queries.

For these (as applicable) , replace these with the actual numbers needed.

X = The New group to move them into
Y = The Old group to move from
P = (where used) This many posts

Moving all members from one group to another...
UPDATE ibf_members SET mgroup = X WHERE mgroup = Y


Moving members with more than a certain amount of posts into a new group...
UPDATE ibf_members SET mgroup = X WHERE mgroup = Y AND posts > P


Moving members with less than a certain amount of posts into a new group...
UPDATE ibf_members SET mgroup = X WHERE mgroup = Y AND posts < P


Again, if in doubt: Stop, do not do anything and ask advice.

:)

wto, 18 maj 2010

Komentarze:

Brak komentarzy

Imię/Nick:

Adres email:

Strona WWW:

Treść Komentarza: