如果我在mySQLi中使用準備語句,我是否仍然需要以任何方式轉義或檢查用戶輸入。因此,舉例來說,如果我有代碼:PHP&mySQLi:使用準備語句時是否還需要檢查用戶輸入?
$members = new mysqli("localhost", "user", "pass", "members");
$r_email = $_POST['r_email'];
$check = $members->prepare("select user_id from users where email = ?");
$check->bind_param('s', $r_email);
$check->execute();
$check->store_result();
if ($check->num_rows > 0) {
echo "user already registered";
$check->close();
}
$members->close();
我需要改變$r_email = $_POST['r_email']
到$r_email = mysql_real_escape_string($_POST['r_email']);
感謝。
[PHP MySQLi準備的查詢綁定參數是否安全?](http://stackoverflow.com/questions/1561586/are-php-mysqli-prepared-queries-with-bound-parameters-secure) – outis 2012-07-19 10:03:42