In SQL, how can you prevent SQL injection in your queries?

  • Use stored procedures
  • Encrypt the database
  • Use Object-Relational Mapping (ORM)
  • Sanitize and parameterize inputs
To prevent SQL injection, you should sanitize and parameterize user inputs in your queries. This involves validating and escaping user input data to ensure that it cannot be used to execute malicious SQL commands. Other options, while important, do not directly prevent SQL injection.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *