Does the following PHP MySQL statement protect against SQL Injection?
$strSQL = "SELECT * FROM Benutzer WHERE Benutzername = '".$Benutzer."' AND Password = '".md5($PW)."'";
The Variables $Benutzer
and $PW
are inputs from the User.
We're checking the username and password against common SQL Injection techniques:
' or 0=0 --
," or 0=0 --
,or 0=0 --
,' or 0=0 #
," or 0=0 #
,or 0=0 #
,' or 'x'='x
," or "x"="x
,') or ('x'='x
,' or 1=1--
," or 1=1--
,or 1=1--
,' or a=a--
," or "a"="a
,') or ('a'='a
,") or ("a"="a
,hi" or "a"="a
,hi" or 1=1 --
,hi' or 1=1 --
,hi' or 'a'='a
,hi') or ('a'='a
andhi") or ("a"="a
.
Am I missing something? Should I use a different method to protect against SQL injection?