nerdexam
Zend

200-550 · Question #93

What is the preferred method for preventing SQL injection?

The correct answer is A. Always using prepared statements for all SQL queries. See the full explanation below for the reasoning.

Question

What is the preferred method for preventing SQL injection?

Options

  • AAlways using prepared statements for all SQL queries.
  • BAlways using the available database-specific escaping functionality on all variables prior to
  • CUsing addslashes() to escape variables to be used in a query.
  • DUsing htmlspecialchars() and the available database-specific escaping functionality to escape

How the community answered

(61 responses)
  • A
    84% (51)
  • B
    2% (1)
  • C
    10% (6)
  • D
    5% (3)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice