PDA

View Full Version : SQL query for mass updating profile ?


IncubuRs
Thu 5th Jun '08, 1:54pm
Hello .. I've added a new profile field required on registeration ..

For example .. what are using now :-
vB 3.5
vB 3.6
vB 3.7

There is an SQL query or a way to mass change the vB 3.5 to vB 3.6 for all members ?
( I don't want to delete or merge the vB 3.5 Field )

IncubuRs
Fri 6th Jun '08, 3:52pm
euhm .. bump up ?
lol guys .. I have unanswered bumped 3 questions till now :d
I know you are swamped in problems but I really need help urgently


thank you
:)

briansol
Sat 7th Jun '08, 2:04am
no one will know exactly but you.

you need to find the field id, and then the way you store your values.


if the values are stored as plain text, you could do something like:


update PREFIX_userfield
set fieldX = 'vB 3.6' where fieldX = 'vB 3.5'
if you used id/value style for the listings, you would have to set it to the id like:


update PREFIX_userfield
set fieldX = 2 where fieldX = 1
where 1 represents vb 3.5 and 2 represents vb 3.6


obviously, you need to change PREFIX_ to the table prefix you use (or nothing at all) and the X in fieldX to the actual field number of your extra profile option.



MAKE A BACK UP FIRST. THERE IS NO UNDO!!!!

IncubuRs
Sat 7th Jun '08, 8:37am
aha

Brian iam using a drop down menu on registeration .. the userfield table has some lines .. the line which contains the info I want to update is field5 how the command will be now ?
I want to add like one value up for the all fields

briansol
Sun 8th Jun '08, 4:34am
you will most likely want to run it for each section, starting with the new option on top.

update PREFIX_userfield
set field5 = 'vB 3.7' where field5 = 'vB 3.6'

update PREFIX_userfield
set field5 = 'vB 3.6' where field5 = 'vB 3.5'

and so on

IncubuRs
Sun 8th Jun '08, 7:55am
Man, I just want to say one thing ..

I LOVE you

:D