Does PDO by default use html special chars? Or even better can I turn it on or off using php, I cannot find any documentation on whether this is possible or not?
Just to clarify, if using prepared statements I am nearly invincible to injection?
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.
No; PDO is a database library, and hence doesn’t care about HTML. If you’re displaying data from your database in a web page, you still need to HTML-escape it for display.
As long as you don’t interpolate values directly into your queries, then yes — you are not vulnerable to SQL injection.