Log in

View Full Version : Mass Change Profile Field Option?


Fluke667
02-06-2012, 05:36 PM
I Have a "Single-Selection Menu" Profile Field with 3 Options:

Option1
Option2
Option3

Over 800 Registered Members have Choosen Option2 and i want Mass Change them to Option1.

How To?

kh99
02-06-2012, 05:56 PM
You can do it with a query, something like:

UPDATE userfield SET fieldX = 'Option 1' WHERE fieldX = 'Option 2'


You have to replace X, 'Option 1' and 'Option 2' with the actual field id and the actual values of options 1 and 2.

Fluke667
02-06-2012, 06:27 PM
Thanks so much...

How can i list all the Options users have Choosen?

I ask this cause i have 3500 users and with vbulletin user search i can find only 900 users with Option Choosen :(

kh99
02-06-2012, 06:36 PM
You can do something like:

SELECT userid, fieldX FROM userfield


What happens when you create a new profile field is even if you specify a default, existing users will have no value for that field until they edit their profile. So I suspect you have 2600 users with no value for that field because of that.

Fluke667
02-06-2012, 06:37 PM
Just downloaded vb3_userfield table ...

(3542, NULL, NULL, NULL, NULL, NULL, '', '', 'Option1', ''),
(3541, NULL, NULL, NULL, NULL, NULL, '', '', 'Option1', ''),
(3576, NULL, NULL, NULL, NULL, NULL, '', '', 'Option1', ''),

This users have the Option Set but other users not have the Option set:

(31, NULL, '', '', '', '', 'Mann', 'Netherlands', '', ''),
(32, NULL, '', '', '', '', 'Mann', 'Netherlands', '', ''),
(33, NULL, '', 'nederland', 'music/films', '', 'Mann', 'Netherlands', '', ''),

--------------- Added 1328557827 at 1328557827 ---------------

and if i do that:

UPDATE userfield SET field10 = 'Option 1' WHERE field10 = ''


'' = can this be empty?

--------------- Added 1328558525 at 1328558525 ---------------

LOL it worked like a charm ^^

Thanks so much :D