php pdo double quotes also getting escaped

I am using php pdo->quote to before injecting values into database. but surprisingly double quotes (") are also getting escaped! tried disabling magic_quotes_gpc, magic_quotes_runtime, magic_quotes_sybase in php.ini .htaccess and also by ini_set. still out of luck. the double quotes are getting escaped along with the single quotes. It's not only adding slashes while inserting values to database, even a simple echo $pdo->quotes('hi "this" is a test'); is giving me 'hi "this" is a test' as output. I dont want to escape the double quotes! Is there any workaround without switching to prepared statements? I avoided prepared statements because of many issues I was facing!

I am sure that i haven't used addslashes anywhere. is there any work around to fix this issue? im using xampp 1.8.2. Kindly help. Thanks!


giving me 'hi "this" is a test' as output.

that's correct output. There is absolutely nothing wrong with it. You shouldn't worry of these slashes at all.

I dont want to escape the double quotes!

You do. At least as long as you are using this function.

Anyway, you should use prepared statements instead.

链接地址: http://www.djcxy.com/p/93662.html

上一篇: 查询到PDO导致不需要的转义

下一篇: PHP的pdo双引号也越来越逃脱