{"id":5742,"date":"2012-06-11T23:22:21","date_gmt":"2012-06-11T17:52:21","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=5742"},"modified":"2012-06-12T11:00:59","modified_gmt":"2012-06-12T05:30:59","slug":"removingreplacing-special-character-from-db","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/removingreplacing-special-character-from-db\/","title":{"rendered":"Removing\/replacing special character from database."},"content":{"rendered":"<p>Recently in one of my project i faced a problem that database was having special character, which is shown as space on the User Interface.<\/p>\n<p>So as to solve this issue i found a very simple solution which consists of following steps:<\/p>\n<p>1. First, you just need to identify which type special character to be removed\/replaced like in my case it was shown as space but stored as &lt;?&gt; in the db.<\/p>\n<p>For that you can use the query.<\/p>\n<p>[sql]select HEX(email) from person;[\/sql]<\/p>\n<p>and you can also refer to this <a title=\"Ascii code\" href=\"http:\/\/www.danshort.com\/ASCIImap\/\" target=\"_blank\">link<\/a> for ASCII code of character. In my case it was 160.<\/p>\n<p>2. \u00a0Now, next step is simple just run this query.<\/p>\n<p>[sql] update person set email=replace(email,char(160),&#8221;); [\/sql]<\/p>\n<p>Thats it !!! \u00a0\ud83d\ude42<\/p>\n<p>It helps me a lot!!! Hope that helps you guys!!!<\/p>\n<p>Anuj Aneja<\/p>\n<p>Intelligrape Software Pvt. Ltd.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently in one of my project i faced a problem that database was having special character, which is shown as space on the User Interface. So as to solve this issue i found a very simple solution which consists of following steps: 1. First, you just need to identify which type special character to be [&hellip;]<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4},"categories":[1],"tags":[4843,76],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5742"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=5742"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/5742\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=5742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=5742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=5742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}