Php Objective Questions with Answers for written test exams 52

Question 52
If $foo is anticipated to be a string, what modification made to the following

query will mitigate the risk of an SQL injection vulnerability?

$sql = “insert into mytable values ($foo)”;

A. Specify the column name in the SQL statement.

B. Remove the parentheses surrounding $foo.

C. Replace the parentheses surrounding $foo with single quotes.

D. Add single quotes around $foo
Answers 52


Answer D is correct. Answer A is incorrect because specifying the column name

does not affect the behavior of the SQL statement. Answers B and C are incorrect

because the parentheses are required.

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---