I have a table, which I need to echo as json to js. Structure is:
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.
I have problems with "params", as some extra quotes remain if I try to use stripslashes and invalidates json.
<?php
...
$statement=$pdo->prepare("SELECT params FROM content WHERE id = 19");
$statement->execute();
$results=$statement->fetchAll(PDO::FETCH_ASSOC);
$json=json_encode($results);
$json = stripslashes($json);
var_dump ($results);
echo "<br/>";
echo $json;
?>
