vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Mass Change Profile Field Option? (https://vborg.vbsupport.ru/showthread.php?t=278143)

Fluke667 02-06-2012 05:36 PM

Mass Change Profile Field Option?
 
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:

Code:

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:

Code:

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 [DATE]1328557827[/DATE] at [TIME]1328557827[/TIME] ---------------

and if i do that:

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


'' = can this be empty?

--------------- Added [DATE]1328558525[/DATE] at [TIME]1328558525[/TIME] ---------------

LOL it worked like a charm ^^

Thanks so much :D


All times are GMT. The time now is 01:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00925 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete