2

I bind all variables to all kind of statements (UPDATE/INSERT/SELECT etc.) using the bind_param() function. But I am confused with bind params.

Do I also need to use real_escape_string even though I use bind_param? Are both of them completely different things?

1 Answer 1

6

No you don't need to escape them. Binding params eliminates the need for escaping by removing the dangers of string concatenation.

With binding, you're essentially telling MySQL to use the contents of this variable as the value for this field.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.