How can you prevent SQL injection vulnerabilities in your PHP code?आप अपने PHP कोड में SQL इंजेक्शन कमजोरियों को कैसे रोक सकते हैं?
Show answerHide answer
Correct answer: (B) By not using user input in queriesक्वेरीज़ में उपयोगकर्ता इनपुट का उपयोग न करके
Explanation
SQL injection happens when raw user input is joined into a query string. The fix is not to put user input directly into queries: use prepared statements or parameterised queries (PDO or mysqli) so input is treated as data, not code.SQL injection तब होता है जब कच्चे उपयोगकर्ता इनपुट को query स्ट्रिंग में जोड़ दिया जाता है। समाधान यह है कि उपयोगकर्ता इनपुट को सीधे queries में न रखें: prepared statements या parameterised queries (PDO या mysqli) का उपयोग करें ताकि इनपुट डेटा माना जाए, कोड नहीं।