From what do sql parameters protect you?

前端 未结 6 1015
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 00:26

Parameters are used to protect you from malicious user input.

But if the parameter expects a string, is it possible to write input that will be interpreted as sql, s

6条回答
  •  北海茫月
    2020-12-04 01:03

    Parameterized queries generally quote the parameter if it is a string behind the scene so that the normal SQL operators are not interpreted as such. This means that even if a user enters potentially malicious data it is simply treated as a string input and not interpreted as SQL operators/commands.

    There may be technical differences in how it is implemented in the various frameworks, but the basic idea (and result) is the same.

提交回复
热议问题