I would suggest you write a function to sanitize user input, and then run all the query variables. When I wrote my book, I did something like:
- avoid single quotes
- delete and other special characters and
- make sure you were unable to - (comment) the end of the report.
Most SQL injections will try something like ' or 1=1 or a=' so the SQL code:
SELECT * from mytable where mycolumn = '' or 1=1 or a=''
Thus, escaping single quotes is really a big issue that you need to worry about.
Carter cole
source share