开发者

Binding params and escaping string in MySQLi (PHP)

I bind all variables to all kind of statements (UPDATE/INSERT/SELECT etc.) using the bind_param() function. But I am confused with bind params.

Do I also need to use real_escape_string even tho开发者_Python百科ugh I use bind_param? Are both of them completely different things?


No you don't need to escape them. Binding params eliminates the need for escaping by removing the dangers of string concatenation.

With binding, you're essentially telling MySQL to use the contents of this variable as the value for this field.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜