Which method is more secure between MySQLi and PDO [closed]

爷,独闯天下 提交于 2020-02-03 11:07:09

问题


So far, I'm seeing that both MySQLi and PDO are good methods when connecting to the database. What I need is which method is more secure between the two. Especially for a person developing a site for a big project that will interact will a large number of people


回答1:


Both libraries provide SQL injection security, as long as the developer uses them the way they were intended (proper escaping / parameter binding with prepared statements when it's needed).

There is no difference in security. The main difference between PDO and Mysqli is that PDO supports various databases and mysqli supports only MySQL. MySQLi is also a bit faster. PDO supports 12 different drivers, opposed to MySQLi, which supports MySQL only.

So about security there's no difference because they both use prepared statements with escaping.



来源:https://stackoverflow.com/questions/16647851/which-method-is-more-secure-between-mysqli-and-pdo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!