Working with punctuation and special characters in MySQL Console
2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: September 27, 2017 (RSS)
By JeffC - September 27, 2017
Hi
I would like to make site-wide changes to my meta title and meta descriptions using the MySQL Console plugin. The value that I would like to input contains an apostrophe
I have managed to overcome the syntax error with two methods (see below) but both of these result in the apostrophe being replaced with the html code (') in my meta tags
UPDATE cms_exampleTable SET field='value\'s';
UPDATE cms_exampleTable SET field="value's";
Result: value's
I've got 200+ pages to update, so would rather not do each page manually if it can be avoided.
Thanks
Jeff
By Dave - September 27, 2017
Hi Jeff,
I'm not able to reproduce that locally. Are your metatags being displayed with the htmlencode() function? That would cause ' to get encoded.
Also note that within the any meta tag attributes it would be valid HTML to htmlencode a single quote. See: https://webmasters.stackexchange.com/a/12343
But that said, it should be being done on display in the page code, not stored in the database that way.
Let me know if that makes sense and any questions.
interactivetools.com