HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Any mySQL/MariaDB gurus around? Need help with query

whu606whu606 MVP
edited March 2019 in General Banter

I'm looking to update from using Emotify plugin to using Emoji Extender.

I've got the plugin side working fine.

For existing posts, I need to replace, for example, ;lol with :lol:

However, I keep running into an issue that I assume relates to the semicolon.

A test query using this syntax:

UPDATE `gdn_comment` SET `Body`= REPLACE (`Body`, 'banjax', 'banjacks'), WHERE `Body` LIKE '%banjax%'

works as expected

but

UPDATE`gdn_comment`SET`Body`=REPLACE(`Body`,';lol',':lol:'),WHERE`Body`LIKE'%;lol%'

throws an error.

I've looked on the Interwebby, and there is advice to escape the ; or that you don't need to.

I've tried

UPDATE`gdn_comment`SET`Body`=REPLACE(`Body`,'\;lol',':lol:'),WHERE`Body`LIKE'%\;lol%'

and variations thereof, with no luck.

If anyone has any suggestions I'd be grateful.

It's not mission critical, but I would like to know how to do it if possible.

Thanks

Tagged:

Comments

Sign In or Register to comment.