MCQs > IT & Programming > PHP > Best practice for running MySQL queries in PHP? Consider the risk of SQL injection.

PHP MCQs

What is the best practice for running MySQL queries in PHP? Consider the risk of SQL injection.

Answer

Correct Answer: Use PDO prepared statements and parameterized queries: for example: $input= $_POST[“user-input”] $stmt = $pdo->prepare(„INSERT INTO table (column) VALUES (“:input”); $stmt->execute(array(„:input‟ => $input));

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it