mysql不存在共享池概念,使用绑定变量避免sql注入,增加安全性。
php5开始mysqli扩展支持PrepareStatement.建议使用PrepareStatement+Bind-variable实现。
$stmt = $dbh -> prepare("select * from users where username=? and password=?");
$stmt -> execute(array($username,$password));
转换函数
mysql不存在共享池概念,使用绑定变量避免sql注入,增加安全性。
php5开始mysqli扩展支持PrepareStatement.建议使用PrepareStatement+Bind-variable实现。
$stmt = $dbh -> prepare("select * from users where username=? and password=?");
$stmt -> execute(array($username,$password));
转换函数