Skip to content
Sharp

OWASP Vulnerabilities · interview question

Why is it important to use prepared statements in SQL queries?

Multiple choiceHardchapter-17-curatedpremiumowasp-vulnerabilitiescross-site-scripting-xss
Choose one answer
Answer and explanation

Correct answer

C. To prevent SQL injection attacks

Why

Prepared statements separate SQL code from data, preventing attackers from injecting malicious SQL code by treating input as data rather than executable code.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →