|
|
|
|
|
by derpmeister
5098 days ago
|
|
It doesn't hurt to prepare a statement, execute it once and then deallocate it. Intersect the user-selected columns with a whitelist of possible columns, use a simple flag for sorting and map it to ASC/DESC. Prepend the primary key, bind parameters, execute, harvest the results, deallocate temporary resources. This is somewhat less efficient, but if the alternative is to be open to sqli attacks it'd be my pleasure. |
|
Congratulations, we are no longer relying on bound parameters to prevent SQL injection. THREAD FINISHED! :)