Need help understanding nested replace statements

Is this only for Microsoft SQL? If so, maybe I need to ask this elsewhere.

I wrote the following query to find WIndows-1252 characters and convert them to utf8 characters.

UPDATE sbf_POSTS a
JOIN sbf_TOPICS t ON a.TOPIC_ID = t.TOPIC_ID
JOIN sbf_FORUMS f ON t.FORUM_ID = f.FORUM_ID
SET a.POST_BODY = REPLACE(a.POST_BODY, '“', '“')
WHERE a.POST_BODY LIKE '%“%'
AND f.FORUM_ID != '24'
AND f.FORUM_ID != '57';

That works fine, but i have to edit it every time i want to fix a different character. So, I thought I'd write a nested replace statement (with the help of chatbot).

This is what chatbot came up with.

UPDATE sbf_POSTS a
JOIN sbf_TOPICS t ON a.TOPIC_ID = t.TOPIC_ID
JOIN sbf_FORUMS f ON t.FORUM_ID = f.FORUM_ID
SET a.POST_BODY = REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
a.POST_BODY,
'“', '“'
),
'”', '”'
),
'‘', '‘'
),
'’', '’'
),
'…', '…'
),
'‑', '‑'
),
'–', '–'
),
'—', '—'
),
'‑', '‑'
)
WHERE (
a.POST_BODY LIKE '%“%' OR
a.POST_BODY LIKE '%”%' OR
a.POST_BODY LIKE '%‘%' OR
a.POST_BODY LIKE '%’%' OR
a.POST_BODY LIKE '%…%' OR
a.POST_BODY LIKE '%–%' OR
a.POST_BODY LIKE '%—%' OR
a.POST_BODY LIKE '%‑%'
)
AND f.FORUM_ID != '24'
AND f.FORUM_ID != '57';

But I'm getting an error which chatbot can't seem to figure out.

SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE (
a.POST_BODY LIKE '%“%' OR
a.POST_BODY LIKE '%”%' ' at line 33
SQL Error: 1064

I know this is a syntax error. I just can't figure out what's wrong with the syntax.

You are using MySQL. This forum is on SQL Server. You will get better help posting in a MySQL forum

Thank you.