Do prepare statements secure your database?

前端 未结 4 1588
执笔经年
执笔经年 2021-01-18 01:10

I know that this question may be closed by some of you, but my question came up from you and your answers. I am reading the past two hours questions and answers for SQL Inje

4条回答
  •  独厮守ぢ
    2021-01-18 01:31

    Both. Prepared statements will protect you against SQL injections if, and only if, you use them in a correct manner. Just' using' prepared statements won't help if you're still interpolating variables for table/column names for example.

    $stmt = "SELECT * FROM $table WHERE $column = ?"; //not good...
    

提交回复
热议问题