What do I need to escape when sending a query?

前端 未结 11 1338
执念已碎
执念已碎 2021-01-07 18:01

When you execute a SQL query, you have to clean your strings or users can execute malicious SQL on your website.

I usually just have a function escape_string(blah),

11条回答
  •  情书的邮戳
    2021-01-07 18:52

    You're better off using prepared statements with placeholders. Are you using PHP, .NET...either way, prepared statements will provide more security, but I could provide a sample.

提交回复
热议问题