I want users to be able to enter a limit for a query. As part of mysql syntax, the LIMIT
can't have quotes around it, and can have digits and a comma. It would be very easy to do this:
preg_replace(/[^\d,]/, '', $request->post('limit'))
...however, this is insecure since the sanitation is not done at the DB class level.
What is the proper way to sanitize inputs to queries that are not parameters (such as column names, limit amounts, etc.)?