Avoiding SQL Injection using Parameters
SQL injection can be avoided by using Parameters is a well known fact. I just want a detailed idea of how it works. Thanks in Advance.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Sep 15, 2014, 2:04 PM EDT
It already knows what the query is going to do and that the parameters are just placeholders for data, not SQL commands. Consequently, there is no chance that when the actual data is inserted it will change the nature of the query and, since it also knows the type of the data, any mismatch will be immediately detected and an error flagged up.
Murugesh P85 reputationPosted Sep 16, 2014, 11:22 PM EDT