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.
只是想确保我的所有查询都经过消毒。我们正在使用 ADOdb(它已经到位,所以不要劝我)。
ADOdb 中是否有类似 mysql_real_escape_string 的内容?
使用参数化查询。
MySqlCommand cmd = new MySqlCommand(); string usernName = ...; cmd.CommandText = "select userid,age from Users where username=@username)" cmd.Parameters.AddWithValue("@username", userName);; MySqlDataReader reader = smd.ExecuteReader();