Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Please clarify what you need escaped. You said that spaces should not be escaped for example. OK, what else should be? Only quotes? How about semicolons? In the example you show, you want one set of double quotes escaped but not the other. How would that work? Commented Feb 6, 2015 at 18:45
  • I've updated the question. Commented Feb 6, 2015 at 18:53
  • 1
    And desired output of that example is...? Commented Feb 6, 2015 at 18:58
  • 1
    So, should the $$ become \$\$? Should \"weird\" become \\\"weird\\\"? Commented Feb 6, 2015 at 19:01
  • Normally, every database (driver, …) already provides boilerplate (prepared statements, escape functions, …) to handle arbitrary data properly. Why not just use those? Commented Feb 7, 2015 at 15:33