0

i'm trying to put json_encoded strings containing html tags into mysql5. the problem is that the data in mysql seems automatically unescaped all "s. data is fed by POST and i'm using standard mysql_query.

if i print any json string into browser it shows as correctly escaped, \". but when inserted into mysql all \"s became "s. naturally unescaped "s make string non-json. any solutions will be appreciated.

1
  • Please post the relevant code. Commented Dec 9, 2010 at 18:39

1 Answer 1

1
mysql_real_escape_string($s);
Sign up to request clarification or add additional context in comments.

2 Comments

...or parameterized (prepared) statements
You should probably add a link to the documentation and format that snippet as code. +1 for the (probably) helpful answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.