Have small problem with storing json string in mysql table. String for example:
'{"variable":"content here with \" addsleshes "}'
created with json_encode. Store this string in DB with simple mysqli_query function.
mysqli_query('insert into ... values \'{"variable":"content here with \" addsleshes "}\' ');
After this :
mysqli_query('select *..');
mysqli_fetch_array($res);
When I get this field from Mysql and try to use php json_decode it will return NULL because I no longer have the slash before the " . Cannot use addslashes function as it will add slashes also like \"variable\". Not sure how to solve this problem?