Today, mysql_real_escape_string() is escaping single quotes AND double quotes

前端 未结 2 664
孤街浪徒
孤街浪徒 2021-01-20 01:47
$str = \'BEGIN This is a \"quote\" test. \\\'Single\\\' END\';
echo $str . \"\\n\";
echo mysql_real_escape_string($str);

// Outputs:
BEGIN This is a \"quote\" test.         


        
2条回答
  •  走了就别回头了
    2021-01-20 02:17

    Sounds like magic quotes got turned on.

    This post details your problem exactly, along with fixes. http://www.sitepoint.com/forums/showthread.php?t=545824

提交回复
热议问题