Using stripslashes after mysql_real_escape_string

后端 未结 3 1510
清歌不尽
清歌不尽 2021-01-16 19:10

I have to escape some inputs on a form. I used mysql_real_escape_string to escape the value but it adds a lot slashes with value inside database, the reason is i have an apo

3条回答
  •  伪装坚强ぢ
    2021-01-16 19:36

    If you have magic_quotes_gpc enabled you should use the stripslashes() function before escaping - otherwise you will escape twice, thus loads of slashes.

    http://se.php.net/manual/en/function.mysql-real-escape-string.php

提交回复
热议问题