I have a query like this. This one came from a text box. Because of the ' in it's it closes the string.
I don't want to trap it in the text box. Because I need to allow the text box to write anything the user want as reason.
I tried to put @ before the variable. But it seems it does not work like C# where putting @ before a string makes it literal.
I know this is also vulnerable to injection. But if the solution has also to do with injection might as well hit two birds in one stone. But if its possible to solve just the escaping the characters that will do.
$_GETVARS['txtReason'] = "'it's already there, in droves.'";
UPDATE tablename SET reason_for_exception='".$_GETVARS['txtReason']."' WHERE ID='1'