Re:Hardcoded secrets, unverified tokens, and other common JW...
by corty on Saturday June 27, 2020 @04:57PM
(#23664636)
some parts of a query cannot be parameterized, e.g. the column name for an 'order by' in many cases. So you have to do some kind of escaping, sanitation and concatenation.
[ Parent
| on HN ]
Re:Hardcoded secrets, unverified tokens, and other common JW...
by namibj on Sunday June 28, 2020 @03:26AM
(#23667243)
If you're escaping/sanitizing to massage an input string until you can concatenate it into a SQL query, you're doing it wrong. Please don't.
Re:Hardcoded secrets, unverified tokens, and other common JW...
by tester756 on Saturday June 27, 2020 @07:51PM
(#23665653)
While this solution isn't sexy, cannot it be just simple switch?
switch(int)
case 1: age
case 2: salary