我不太了解SQL注入,但我想要一个简单的答案,因为我只想知道我是否应该只在一个字符串或所有字符串中放置替换(a,"'","''")案件?
vb.net中的示例
"select email from users where id=" & Replace(myId, "'", "''")
Run Code Online (Sandbox Code Playgroud)
和
"select email from users where surname=" & Replace(mySurname, "'", "''")
Run Code Online (Sandbox Code Playgroud)
第一种情况下的替换是否无用?
编辑:
我的问题不是"什么是最好使用而不是替换",但如果我必须使用替换也使用非字符串值.谢谢!