The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL Query : Mass move specific users based on usernames, not userid
Hi,
I need to mass move specific users (a couple of hundred of them) based on their usernames, not based on their id, to be deleted at a later time. Each user is unique, with differing post counts, join dates, etc. I've tried to mess around with some SQL queries but no luck. PHP Code:
I've no knowledge on SQL, so I might be shootin' in the dark here! |
#2
|
|||
|
|||
Code:
UPDATE user SET usergroupid = X WHERE username IN('Apostrophe is important', 'etc') |
#3
|
|||
|
|||
Very kind of you sir! However the list isn't finalized yet, will PM you the list once it's finalized!
However, I don't understand what you mean by the usernames being escaped? --------------- Added [DATE]1333624292[/DATE] at [TIME]1333624292[/TIME] --------------- Managed to do it! I used excel to add the 'apostrophes' and appropriate spaces at the end of each username, and pasted it in the following format: Code:
UPDATE user SET usergroupid = X WHERE username IN( 'adam', 'john', 'mike' ) That allowed me to paste the all the usernames at one go! Thanks again! :up: SOLVED! |
Благодарность от: | ||
Pandemikk |
#4
|
|||
|
|||
By escaped, I mean there are certain characters in usernames that would break the query, most notably an apostrophe itself. But seeing as how everything worked out I'm going to assume none of the username's had an apostrophe in them, anyway.
Glad I could be of assistance. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|