XF 1.3 SQL Query to set a profile field value

Rob

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?
 
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.
 
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.
 
Back
Top Bottom