r/shittyprogramming • • Nov 30 '18

Unbeatable protection from SQL injection.

Just don't name your table "users" so when they do the "DROP TABLE users;" it doesn't work.

143 Upvotes

18 comments sorted by

View all comments

4

u/FragileStudios Dec 01 '18

A better idea would be to only use double quotes e.g " " instead of ' ' in your SQL queries. No hacker would ever try double quotes