mysql_real_escape_string() for $_SESSION variables necessary?

Lyo*_*yon 5 php session-variables mysql-real-escape-string

Should I use the mysql_real_escape_string() function in my MySQL queries for $_SESSION variables? Theoretically, the $_SESSION variables can't be modified by the end-user unlike $_GET or $_POST variables right?

Thanks :)

And*_*ico 4

无论用户是否可以修改数据,您可能都想转义它,以防您需要数据包含会破坏 SQL 的字符(引号等)。

更好的是,使用绑定参数,您就不必担心它。