title: Retrieving JSON data that is saved as text in mysql database using PHP
body: <p>I have a form with number of elments, I encode all the data from the form using json_encode($_POST) and save it to mysql data base. </p>
  
  <p>This is the JSON data i have in mysql database</p>
  
  <pre><code>{"sections":{"int":{"section_name":"Interests","data":"These are my interests"},"ref":{"section_name":"Referance","data":"This Is my referance"},"other":{"section_name":"other","data":"This Is my referance"}}}
  </code></pre>
  
  <p>The JSON data saved to mysql is wellformed. I copy/paste the data from mysql database to jsoneditoronline dot org and checked for errors. The JSON data has no errors at all. </p>
  
  <p>Now when i retrieve the same JSON data using mysql queries, </p>
  
  <p>The start double quote in the JSON is being replaced by &#8220; 
  End double quote is being replaced by &#8221;</p>
  
  <p>So i can't use the JSON data. How can i get exact JSON data from mysql table? </p>
  
  <p>I am using wordpress inbuilt functions to retrive the JSON data</p>
  
  <pre><code>$id=366; 
  $post = get_page($id);
  $JSON = apply_filters('the_content', $post-&gt;post_content); 
  echo $JSON; 
  </code></pre>
  
  <p>The $JSON should have valid JSON according to the data stored in mysql database, but it is being replaced by html special characters automatically.</p>
  
  <p>How to over come this?</p>
  
  <p>How to get valid JSON from mysql database through mysql query? </p>