Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 15
    this answer is misleading. PDO is not a magic wand that protects your queries by a mere presence. You ought to substitute every variable in your query with a placeholder to get a protection from PDO. Commented Jun 12, 2020 at 3:41
  • Do you have any resources or further explain what you mean? when you say substitute every variable in your query with a placeholder do you mean the bindvalue thing? Commented Mar 4, 2022 at 21:35
  • @Daniel L. VanDenBosch we might call these host variables? Most embedded SQL systems call them that. If they are not placeholders they are constants, even if the value gets to a host field that can hold other values. Minimising the number of variables provides for a predictable access path, but reduces re-usability obviously.
    – mckenzm
    Commented Sep 23, 2022 at 0:18