Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 200-710 topic 1 question 26 discussion

Actual exam question from Zend's 200-710
Question #: 26
Topic #: 1
[All 200-710 Questions]

Is the following code vulnerable to SQL Injection where ($mysqli is an instance of the MySQLi class)?

  • A. No, the code is fully protected from SQL Injection.
  • B. Yes, because the $name variable is improperly escaped.
  • C. Yes, because the $name variable and the $age variable is improperly escaped.
  • D. Yes. because the $age variable is improperly escaped.
  • E. Yes, because you cannot prevent SQL Injection when using MySQLi
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
ZhukovPeter
4 years, 4 months ago
The answer is really D. Because $age can be: $age = "1 or admon = 1" and this is kind of sql injection that is not prevented. $name is single quoted inside sql query, so it prevents this sql injection.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...