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));
轉換函數