mysql_real_escape_string() leaving slashes in MySQL

前端 未结 9 1079
囚心锁ツ
囚心锁ツ 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:17

    I am not sure if I understand the issue correctly but I had a very same problem. No matter what I did the slashes were there when the string got escaped. Since I needed the inserted value to be in the exact same format as it was entered I used

    htmlentities($inserted_value)
    

    this will leave all inserted quote marks unescaped but harmless.

提交回复
热议问题