3 ms·
I've never understood why you can't write secure code using string concatenation. It seems to me like all it takes is a reliable "quote" method (with proper esc
by Almaviva 15y ago
I've never understood why you can't write secure code using string concatenation. It seems to me like all it takes is a reliable "quote" method (with proper escaping of course), and the discipline to use it on _all_ variables that go into a query. The advantage is that queries are sometimes easier to read and maintain when they're written locally like this, without having to jump down to another line to see what a placeholder will actually contain.
I concede of course that this can't work unless there is absolute discipline in a project to quote absolutely all variables, whether you think they are trusted or not.
Am I missing a key point here?