XF 1.3 Copy "location" data to a custom field

Nudaii

Well-known member
is there a way to copy the contents of the "location" field to a custom profile field?

If so what would be the SQL query?
 
Usually people go the opposite direction:

http://xenforo.com/community/thread...to-xf-stock-location-field.22221/#post-279132

If you want to go location to custom field then use this:

Rich (BB code):
UPDATE xf_user_field_value AS ufv
SET ufv.field_value = (
	SELECT up.location
	FROM xf_user_profile AS up
	WHERE ufv.user_id = up.user_id
)
WHERE ufv.field_id = 'customfield';

Then rebuild the user cache:

Admin CP -> Tools -> Rebuild Caches -> Rebuild User Caches

Backup to be safe.
 
Top Bottom