I'm trying to figure out how to change a string with another string in mySQL. I don't have much experience with databases. I've read several answers here, but I'm still getting errors.
This is what I started with
UPDATE wp_posts SET post_content = REPLACE (
post_content,
'whatever',
'<a href="https://www.notarealdome.com" onClick="ga('send', 'event', 'Banner', 'Link', 'Page');" target="_blank" rel="noopener noreferrer">Hello</a>');
but it keeps giving me errors.
So, I started to escape special characters like ;(),'_> but I still get an error message. What am I missing?
UPDATE wp_posts SET post_content = REPLACE (
post_content,
'whatever',
'<a href="https://www.notarealdomain.com" onClick="ga(''send''\, ''event''\, ''Banner''\, ''Link''\, ''Page''\)\;" target="\\_blank" rel="noopener noreferrer"\>Hello</a\>');