I want to run the following query with a single quoted value.
INSERT INTO web_camp_keywords (web_id, keyword) VALUES (195, 'abc'hotels')
I just want to add abc'hotels value. I used backslash, but it did not work.
INSERT INTO web_camp_keywords (web_id, keyword) VALUES (195, 'abc\'hotels')
How can I resolve this?
abc'hotelsinto a form instead enteredabc'; DELETE FROM web_camp_keywords;--or worse,abc';DROP SCHEMA public CASCADE;--? splat, there goes your entire database. See en.wikipedia.org/wiki/SQL_injection (Note: TheDROP SCHEMAtrick shouldn't work if your app connects with only the minimum required permissions - it shouldn't own the tables or be a superuser - but your app is probably the owner of the tables.)