I’ve read that the PDO::Prepare function creates a safe query. Does this mean escape characters don’t need to be manually literalised? Such as the backslash character.
I’ve read that the PDO::Prepare function creates a safe query. Does this mean escape
Share
No it absolutely does not mean that. What you read is misleading.
There is a difference between a “prepared statement” and a “parameterized query.” You want the latter for sanitation purposes.
For example:
is not safe at all even though it is prepared. Instead, you have to do this:
Preparing the query isn’t going to do anything for you in terms of security if you do not properly parameterize it.