PDA

View Full Version : Entering a value in profile field across ALL users?


donkspurs
07-31-2013, 06:26 PM
Hello,

I've just recently setup a new user profile field on my forum called 'Points'. This field is not editable by any registered user and isn't required on registration, but has a default value on registration.

The problem is, for all current users there is no data in the field and so it looks like this;

https://vborg.vbsupport.ru/external/2013/07/3.png

It's fine however when data is in the field as shown below;

https://vborg.vbsupport.ru/external/2013/07/4.png

So basically I'm just trying to find a way of entering the value of '0' across ALL registered users so that this field looks fine for everyone on the forum.

Thanks for any help!

mokujin
07-31-2013, 06:39 PM
Run this query

UPDATE userfield
SET fieldX = 0

where X is that field number.

donkspurs
07-31-2013, 07:31 PM
Thanks for the help mokujin.

Where do I need to run that query? I'm assuming its on the database, so I've tried it within phpMyAdmin but it says I need to 'choose at least one column to display'.

I'm not exactly sure what I need to put in here;

https://vborg.vbsupport.ru/external/2013/07/2.png

mokujin
07-31-2013, 07:35 PM
in Phpmyadmin go to the database where your vbulletin is installed, then click to table "userfield"

then run that sql UPDATE userfield SET fieldX = 0

make sure you have entered your table prefix before table userfield if you have one.

donkspurs
08-01-2013, 12:19 AM
Thanks a lot mokujin. That's worked brilliantly.

Great help, cheers!

donkspurs
08-03-2013, 02:33 PM
Update on this;

I just tried running this sql again and now I get an error message for some reason.

https://vborg.vbsupport.ru/external/2013/08/42.png
https://vborg.vbsupport.ru/external/2013/08/43.png

Why would it work fine before and not now? Nothing has been changed.

Any ideas? Thanks in advance for any help.

--------------- Added 1375561645 at 1375561645 ---------------

Managed to fix it for myself. It was because the fields already had the '0' data in them from the query I ran before. (silly me)

Therefore it needed a WHERE in the sql.

e.g.

UPDATE userfield SET fieldX = '100' WHERE fieldX = '0'

[hope this helps anyone else who's as silly as me]