Does $_SESSION['username'] need to be escaped before getting into an SQL query?

后端 未结 5 1310
猫巷女王i
猫巷女王i 2021-01-25 01:47

I am wondering if anything from the $_SESSION array needs to be escaped before I use it in a SQL query.

Note that I don\'t use cookies in my application, since I\'ve hea

5条回答
  •  终归单人心
    2021-01-25 02:02

    You need to escape every string you pass to the sql query, ragardless of its origin.

    Even if it is the data you retrieved from your database.

提交回复
热议问题