title: Retrieve json string stored in mysql field
body: <p>I have a table, which I need to echo as json to js. Structure is:</p>
  
  <p><a href="https://i.stack.imgur.com/jpViM.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jpViM.gif" alt="enter image description here"></a></p>
  
  <p>How do I get the data as a json string without extra slashes? I'm not interested in processing params in php or manipulating it in a query, it's used for storage of data (which could vary a lot) and will be used in js side. Using a document based db is not an option at this time.</p>
  
  <p>I have problems with "params", as some extra quotes remain if I try to use stripslashes and invalidates json.</p>
  
  <hr>
  
  <pre><code>&lt;?php
  ...
  $statement=$pdo-&gt;prepare("SELECT params FROM content WHERE id = 19");
  $statement-&gt;execute();
  $results=$statement-&gt;fetchAll(PDO::FETCH_ASSOC);
  $json=json_encode($results);
  
  $json = stripslashes($json);
  var_dump ($results);
  echo "&lt;br/&gt;";
  echo $json;
  ?&gt;
  </code></pre>