Imagine you are developing a PHP application that needs to frequently insert user data into a database. To ensure security and performance, which approach would be most appropriate?

  • Use PDO prepared statements
  • Use raw SQL statements with user input directly in the query
  • Use MySQLi extension with prepared statements
  • Use raw SQL statements with hardcoded values
Using PDO prepared statements is the recommended approach as it's secure against SQL injection and offers good performance.
Add your answer
Loading...

Leave a comment

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