The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Adding member to secondary usergroup via SQL query
I am working on an offsite script and everything is working fine, but I am
having some problems figuring out the best way to add a member to a secondary usergroup if they are already in another through mysql query. I understand I can simply update or insert my data directly in to the membergroupids field but I am asking how I can do this if they are in another secondary usergroup already, since they list separated by commas. So what's the best way to execute a query where I can add the new groupid to membergroupids if the member has more groups already or none? |
#2
|
|||
|
|||
You can do that with an IF/ELSE case in SQL:
PHP Code:
|
2 благодарности(ей) от: | ||
bridge2heyday, RichieBoy67 |
#3
|
|||
|
|||
Quote:
Update: Nice, it worked perfectly in my situation. Thanks again |
#4
|
|||
|
|||
That's a great way. You can also select the membergroupids and then explode them into an array and add the ID you want and implode and insert again as well. You may have more flexibility if you're doing checks and balances with your update.
Google PHP: implode(); explode(); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|