You do not need to use the "Escape" query strings to prevent SQL injection - you should use prepared statements instead.
Ideally, your input filtering will occur before any other processing, so you know that it will always be used. Because otherwise, you only need to skip one place to be vulnerable to the problem.
Remember to encode HTML objects in the output - to prevent XSS attacks.
source
share