AlexWright Posted May 14, 2018 Posted May 14, 2018 Hi all! We made a mistake with enabling the replacement of text to emoji, so that © this symbol became an emoji. We are trying to undo that for some of the image descriptions through an SQL query, and could use some help with this. We know it would likely be an update statement, but it get's tricky. We only want to replace this text: <span class="ipsEmoji">↔</span> With just the plain copyright symbol, ©. So it would probably be along the lines of: UPDATE `ips_gallery_images` SET image_description = '©' WHERE image_description = "<span class="ipsemoji">↔</span> I obviously know this is incorrect. I'm just trying to save some members the hassle of trying to update over 200 images. Actually, would this work? UPDATE ips_gallery_images SET image_description = REPLACE(image_description,'<span class="ipsemoji">↔</span>','©') WHERE image_description LIKE '%<span class="ipsemoji">↔</span>%'
bfarber Posted May 15, 2018 Posted May 15, 2018 Yes, the REPLACE query is the route you want to go. Take a database backup first.
AlexWright Posted May 15, 2018 Author Posted May 15, 2018 9 minutes ago, bfarber said: Yes, the REPLACE query is the route you want to go. Take a database backup first. Thanks! Also, shouldn't the Code field not parse emoji?
bfarber Posted May 15, 2018 Posted May 15, 2018 An "emoji" is just another character code sequence. The code field is designed not to 'parse' anything, but if you insert an emoji then it will stay an emoji. Imagine if there was a full blown programming language using emoji!? (Hint: There is. https://www.emojicode.org/ )
AlexWright Posted May 16, 2018 Author Posted May 16, 2018 Got it. UPDATE ips_gallery_images SET image_description = REPLACE(image_description,'<span class="ipsEmoji">©</span>','©') WHERE image_description'LIKE '%<span class="ipsEmoji">©</span>%' Worked like a charm. Thanks @bfarber
Recommended Posts
Archived
This topic is now archived and is closed to further replies.