0
我已经使用了PDO:如何清理php中的数据以避免SQL注入?
$stmt = $aPDO->prepare("INSERT INTO ".$this->getM_oUser()->getM_sTableName()." (email, hash_pw, hash_key) VALUES (:email, :hash_pw, :hash_key)");
$stmt->bindValue(':email', $this->getM_oUser()->getM_sEmail());
$stmt->bindValue(':hash_pw', $this->getM_oUser()->getM_sHash_pw());
$stmt->bindValue(':hash_key', $this->getM_oUser()->getM_sHash_Key());
$stmt->execute();
是否也应该使用mysql_real_escape_string()来处理用户输入的字符串?谢谢。
的可能重复[PDO是准备充分,以防止SQL注入语句?(HTTP://计算器的.com /问题/ 134099/ARE-PDO-制备语句-足以对防止-SQL注入) –