I have been trying to compress and store a json encoded string into mysql, but I am getting "unexpected /" errors.
I also tried to use addslashes like this:
addslashes(gzcompress(json_encode($mystring)));
And to display
json_decode(gzuncompress(stripslashes($mystring)));
But it fails on insert with the error I mentioned.
I read somewhere a string with gzcompress should be stored as a blob, but I was hoping there is a way to store it in a mysql text field so I dont have to mess with the db.
PS: Some asked for full error message here it is:
Warning: Unexpected character in input: '\' (ASCII=92) state=1
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\x9C\xED}\x8Br\xDB...' for column 'field_text_value' at row 1.