在防止 SQL 注入方面,SQL Server 和 MySQL 之间有什么区别吗? [英] Are there any differences between SQL Server and MySQL when it comes to preventing SQL injection?

查看:52
本文介绍了在防止 SQL 注入方面,SQL Server 和 MySQL 之间有什么区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯用 PHP/MySQL 开发,没有用 SQL Server 开发的经验.我浏览了 PHP MSSQL 文档,它看起来类似于 MySQLi我读过的一些方法.

I am used to developing in PHP/MySQL and have no experience developing with SQL Server. I've skimmed over the PHP MSSQL documentation and it looks similar to MySQLi in some of the methods I read about.

例如,对于 MySQL,我使用函数 mysql_real_excape_string().PHP/SQL Server 有没有类似的功能?

For example, with MySQL I utilize the function mysql_real_excape_string(). Is there a similar function with PHP/SQL Server?

我需要采取哪些步骤来防止 SQL Server 的 SQL 注入?

What steps do I need to take in order to protect against SQL injection with SQL Server?

SQL Server 和 MySQL 在 SQL 注入预防方面有什么区别?

What are the differences between SQL Server and MySQL pertaining to SQL injection prevention?

还有 - 这个帖子准确吗?SQL Server 的转义字符串字符是单引号吗?

also - is this post accurate? is the escape string character for SQL Server a single quote?

推荐答案

使用 PDO参数化查询 和每个数据库引擎看起来几乎一样.

Use PDO and parameterized queries and every database engine looks almost the same.

这篇关于在防止 SQL 注入方面,SQL Server 和 MySQL 之间有什么区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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