Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伙计们,我是 mysql 安全的新手,当我在谷歌上搜索这个问题时,很多人警告我们应该检查 mysql 字符串,看看它是否包含 ',否则你有被注入 mysql 数据库的风险,但他们没有告诉我为什么?你能告诉我原因吗?非常感谢你。
假设您有一个用户表和一个登录表单。通常当用户登录时,您要确定他是否有帐户:
这是非常糟糕的 PHP:
"SELECT * FROM users WHERE username = '$username' AND password = MD5('$password');"
现在你有一个用户名
1';删除表用户;#
会发生什么?