XF 1.3 SQL Query to set a profile field value


Well-known member
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?


XenForo moderator
Staff member
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.


Well-known member
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.


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