I clean post data using mysqli_real_escape_string. Should I also, then, apply addcslashes() to a variable that is used in an SQL LIKE clause?
[I understand that using prepared statements would probably negate this discussion.]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you cannot use prepared statements (always a good option) – as far as I know it is best to escape the mysql like wildcards aswell: