mysql_real_escape_string() leaving slashes in MySQL

前端 未结 9 1097
囚心锁ツ
囚心锁ツ 2020-12-16 16:41

I just moved to a new hosting company and now whenever a string gets escaped using:

mysql_real_escape_string($str);

the slashes remain in the

9条回答
  •  情话喂你
    2020-12-16 17:25

    the slashes remain in the database.

    It means that your data gets double escaped.

    There are 2 possible reasons:

    1. magic quotes are on, despite of your feeling. Double-check it

    2. There is some code in your application, that just mimic magic quotes behaviour, escaping all input.
      This is very common misconception to have a general escaping function to "protect" all the incoming data. While it does no good at all, it also responsible for the cases like this.
      Of so - just find that function and wipe it out.

提交回复
热议问题