php MySQLi 相对于 MySQL 的优势

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1171344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 01:19:42  来源:igfitidea点击:

Advantages Of MySQLi over MySQL

phpmysqlmysqli

提问by Ben Shelock

What are the advantages of using MySQLi over MySQL?

与 MySQL 相比,使用 MySQLi 的优势是什么?

回答by Dominic Rodger

See the docs:

查看文档

What is PHP's mysqli Extension?

The mysqli extension, or as it is sometimes known, the MySQL improved extension, was developed to take advantage of new features found in MySQL systems versions 4.1.3 and newer. The mysqli extension is included with PHP versions 5 and later.

The mysqli extension has a number of benefits, the key enhancements over the mysql extension being:

  • Object-oriented interface
  • Support for Prepared Statements
  • Support for Multiple Statements
  • Support for Transactions
  • Enhanced debugging capabilities
  • Embedded server support

什么是 PHP 的 mysqli 扩展?

mysqli 扩展,或者有时称为 MySQL 改进的扩展,是为了利用 MySQL 系统版本 4.1.3 和更新版本中的新功能而开发的。mysqli 扩展包含在 PHP 5 及更高版本中。

mysqli 扩展有很多好处,对 mysql 扩展的主要增强是:

  • 面向对象的接口
  • 支持准备好的报表
  • 支持多语句
  • 支持交易
  • 增强的调试功能
  • 嵌入式服务器支持

回答by RaYell

PHP Manualexplains the differences

PHP手册解释了差异