Possible Duplicate:
Best way to prevent SQL injection?
I’m working in one PHP project with MYSQL database.
I read about SQL injection but would like to have some basic example.
What would be happen if attacks.?
I’m new in this topic.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically if you have a SQL call like this:
People could input on the form:
My Name' OR InputtedName != 'My NameThis would result in the following SQL Call, when $name is replaced with the inputted name from a form:
That would delete everything in your table! Not good! So to prevent this, you should use the mysql_real_escape_string() function on all user inputted data.