I just found out that if i write
select * from tbl where name like @foo
Then add foo as a parameter with the value \a
(user data) that it will not escape it correctly. What the hell!?! It wants \\a
. I can't help but feel i'm open to a sql inject even though i am using parameters.
How do I escape the user data in variables correctly? I'm using mysql on C# with using dapper.net