escaping characters / json_encode

escaping characters / json_encode

onlyposteronlyposter Posts: 1Questions: 0Answers: 0
edited August 2011 in General
hi.

I'm using the latest version. also using json_encode on the output. for testing purposes, I am taking straight from the database and passing the following to datatables:

[code]
\'" AND \'key\' = 12\'"
[/code]

...but the table doesn't show. FireBug log:

[code]
...\"\\'" AND \\'key\\' = 12\\'"\"...
[/code]

what gives? thanks.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    When you say you are using json_encode, I presume that's in PHP? json_encode takes an array and encodes that into JSON - do you have the correct array for what you want? print_r() will help here.

    Allan
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    you might have Magic Quotes™ turned on in PHP, which is frowned upon these days. you can turn it off in the ini file or in script code.

    http://php.net/manual/en/security.magicquotes.disabling.php
This discussion has been closed.