|
|
|
|
|
by Sorreah
3310 days ago
|
|
I'd much rather read a straightforward example like that in an intro, then reading the complicated prepared statement when going through what's essentially pseudocode. There are valid cases where you're sure that the thing you're looking at is a valid id (ie. you already pulled it out of the database or by generating it yourself), not every program is a webapp that's handling user input, and examples like this aren't meant to teach you best security practices. And yes the login system example would be acceptable if you're discussing something entirely unrelated to actually implementing one. |
|
And the benefits of prepared or parameterized statements don't end at security, they can often have performance benefits as well.
And as for the login pseudocode, if it doesn't have anything to do with the example, hide the implementation: