3 ms·
At the same time I understand why it would be more confusing for newbies. In a language that already has string interpolation you're telling them to use a crap
by wmil 11y ago
At the same time I understand why it would be more confusing for newbies.
In a language that already has string interpolation you're telling them to use a crappier custom version of string interpolation that's safe for databases.
Tutorials need to be more upfront about that.
- sarciszewski 11y agoI've got "writing an open access PHP 7 online book to hopefully serve as a new, best-practices tutorial" next on my to do list.
- sopooneo 11y agoBut if the example above uses PDO underneath, then it's not just string interpolation though I think. It's sending the query and the parameters separately to the database, which is creating a "prepared data object" to plug the parameter values into. I may be wrong, so please correct me if so.