Which of these methods is best to handle a PHP input in order to avoid SQL Injection?

Asked

Viewed 39 times

-4

  • 1
  • 2

    None of the ones you listed have that purpose. For a starting point you can refer to the link that colleague @hkotsubo linked and use the site search and related links, but in short, in Mysql you have mysqli_real_escape_string and in PDO has the quote - In both, a prepare with bind also solves (but beware of PDO, in PDO this is not native), but is mere side effect. The prepare serves to reuse query (again, in PDO is not always effective - remember, PDO is just a compatibility layer), not to exhaust.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.