Quote:
Originally Posted by Hamed
Hello,
I want to know how can I protect from sql injection?
What is the best way?
Is there anyway to add one function for all queries and where get sql injection?
|
If you search this forum you'll find this subject has been discussed many times. Sanitizing input is a multi-step process and no one single step is "it". Validate all incoming data for type, remove potentially malicious characters, and strip common exploit code. After doing that, use mysql_real_escape_string() for all queries to the database or use a custom function that performs the same actions.