OK, well, if this is the case, and neither do() nor prepare() will work if given a string with a semicolon (as if someone had tried to insert a second statement in the form), then why all the hubbub about using placeholders and worrying about someone trying to execute extra commands?
The behavior is database dependent. Though there appears to not be a problem with MySQL, the advice to not construct queries from un-detainted pieces is still sound. Scripts written with one database in mind tend to migrate to other platforms, or are used as templates for new scripts. It's better to "get things right" even if there's no direct risk on the current platform mix.
| [reply] |
Thank you muchly. I tend to have the mindset, "Well, if it works on my system, it'll work on anybody's." (Bad programmer-wannabe! No treat for you!) *ahem* Anyway, lesson learned, so I'll shut up about this now. Thanks again.
| [reply] |