mysql_real_escape_string() 做什么而addslashes() 没有? [英] What does mysql_real_escape_string() do that addslashes() doesn't?

查看:25
本文介绍了mysql_real_escape_string() 做什么而addslashes() 没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们需要像 mysql_real_escape_string() 这样的特定于数据库的函数?addlashes() 不能做什么?

Why do we need a DB-specific functions like mysql_real_escape_string()? What can it do that addslashes() doesn't?

暂时忽略参数化查询的优越替代方案,专门使用 addlashes() 的 web 应用程序是否仍然容易受到 SQL 注入的攻击,如果是,怎么办?

Ignoring for the moment the superior alternative of parameterized queries, is a webapp that uses addslashes() exclusively still vulnerable to SQL injection, and if yes, how?

推荐答案

Addslashes 在处理多字节编码字符串时通常不够好.

Addslashes is generally not good enough when dealing with multibyte encoded strings.

这篇关于mysql_real_escape_string() 做什么而addslashes() 没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆