what does mysql_real_escape_string() really do?

后端 未结 6 818
慢半拍i
慢半拍i 2020-12-07 17:28

One thing that I hate about documentation at times (when you\'re a beginner) is how it doesn\'t really describe things in english. Would anyone mind translating this documen

6条回答
  •  没有蜡笔的小新
    2020-12-07 18:13

    The mysql_real_escape_string() helps you escape special characters such as single quote etc that users may submit to your script. You need to escape such characters because that comes in handy when you want to avoid SQL Injection.

    I would sugggest you to check out:

    mysql_real_escape_string() versus Prepared Statements

    To be on much safer side, you need to go for Prepared Statements instead as demonstrated through above article.

提交回复
热议问题