At the moment, I'm more familiar with MSSQL, but I believe this will also work in MySQL. You haven't indicated what you want to update group_id
to, so I just inserted a random string in there. If you want to set it to the value from another table in the query, you can also do that by doing something like m.group_id = d.group_id
:
UPDATE m SET
m.group_id = 'newValue'
FROM
exp_members m
INNER JOIN exp_channel_titles t
ON m.member_id = t.author_id
INNER JOIN exp_channel-data d
ON t.entry_id = d.entry_id
AND d.field_id_19 LIKE '%[362]%'
As you can see, I've changed your implicit joins to explicit ones (eg INNER JOIN
). I really recommend this syntax, as it's easier to see what's going on by separating your WHERE conditions from your JOIN conditions.
Update:
It looks like MySQL doesn't support the UPDATE...FROM
syntax used above. Try this instead:
UPDATE
exp_members m,
exp_channel_titles t,
exp_channel_data d
SET
m.group_id = 'newValue'
WHERE
m.member_id = t.author_id
AND t.entry_id = d.entry_id
AND d.field_id_19 LIKE '%[362]%'
Again, this isn't tested, but I think it will work. If not, it might at least help you get you closer to your answer.