XF 2.1 Looking for help with a mass update SQL query

DavidXLD

Active member
Hello,

I wish to deactivate all email sending to users if they have been inactive for more than one year.
I am not confident at all with SQL...

Fields to update are :
xf_user_option . receive_admin_email = 0
xf_user_option . email_on_conversation = 0

When
xf_user . last_activity <= 1555804800

Unfortunately I do not know how to build the update SQL creating the join between :
xf_user_option . user_id
xf_user . user_id

I f you can help, it would be great.

Thanks

David
 
SQL:
UPDATE xf_user_option INNER JOIN xf_user ON xf_user.user_id = xf_user_option.user_id
 SET xf_user_option.receive_admin_email = 0, xf_user_option.email_on_conversation = 0 
WHERE xf_user.last_activity <= 1555804800
 
Top Bottom