mysql-sql注入

mysql不存在共享池概念,使用绑定变量避免sql注入,增加安全性。

php5开始mysqli扩展支持PrepareStatement.建议使用PrepareStatement+Bind-variable实现。

$stmt = $dbh -> prepare("select * from users where username=? and password=?");
$stmt -> execute(array($username,$password));

转换函数

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章