Are PHP MySQLi prepared queries with bound parameters secure?

前端 未结 3 1125
温柔的废话
温柔的废话 2020-12-10 18:23

Historically, I\'ve always used

mysql_real_escape_string()

for all input derived from users that ends up touching the database.

Now

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 19:13

    When you bind parameters to a prepared statement, it escapes the data automatically, so you shouldn't escape it before you send it through. Double escaping is usually a bad thing. At the very least, it produces ugly results with extra escaped characters later on.

提交回复
热议问题