• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 SQL Query to set a profile field value

Rob

Well-known member
#1
I'd like to run an SQL query that will set a profile field value for any user who does not already have the field set. Is this possible?
 

Brogan

XenForo moderator
Staff member
#2
Code:
UPDATE xf_table SET option = 'value' WHERE option = '';
That's the general syntax.
It depends on the table and field type though.
Some fields can't be updated like that, if they contain serialised arrays for example.

Take a backup first before doing any work on the database.
 

Rob

Well-known member
#3
The problem is, only 10K entries exist in the table and there are 55K users.

I'd have to use a query that will add a row for the user if one didnt already exist.... its sounding more like a PHP script actually come to think of it as I dont think a query will do the whole thing.
 

Rob

Well-known member
#5
its for custom user fields - its not serialized. you know the built in user fields. the table i think is xf_user_field_value