How do you prevent SQL injection in LAMP applications?

后端 未结 5 1130
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 16:31

Here are a few possibilities to get the conversation started:

  1. Escape all input upon initialization.
  2. Escape each value, preferably when generating the
5条回答
  •  被撕碎了的回忆
    2020-12-20 17:11

    I would go with using prepared statements. If you want to use prepared statements, you probably want to check out the PDO functions for PHP. Not only does this let you easily run prepared statements, it also lets you be a little more database agnostic by not calling functions that begin with mysql_, mysqli_, or pgsql_.

提交回复
热议问题