Which is fastest in PHP- MySQL or MySQLi?

2019-01-10 20:08发布

I'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true?

And I'm only asking about speed. I know mysqli has features that are not present in the older extension.

标签: php mysql mysqli
10条回答
一纸荒年 Trace。
2楼-- · 2019-01-10 20:47

In relation to PHP programming language, MySQL is the old database driver, and MySQLi is the Improved driver. MySQLi takes advantage of the newer features of MySQL 5.

Features of MySQLi taken from php.net site:

  • Object-oriented interface
  • Support for Prepared Statements
  • Support for Multiple Statements
  • Support for Transactions
  • Enhanced debugging capabilities
  • Embedded server support
查看更多
女痞
3楼-- · 2019-01-10 20:48

Maybe, this can be a reason to make the right choice :: The Plot to Kill PHP MySQL Extension

" Yes, you read it right. Recently, Phillip Olson sent to the PHP internals mailing list a proposal to kill the original PHP MySQL extension in future PHP versions. "

查看更多
疯言疯语
4楼-- · 2019-01-10 20:48

The PHP documentation has a good comparison of mysql, mysqli, and PDO. I know you only asked about speed, but others might find this useful. It talks about the feature differences between the options.

查看更多
Root(大扎)
5楼-- · 2019-01-10 20:51

According to all the Google results for benchmarks linked by ceejayoz it looks like MySQL is at least slightly faster than MySQLi in all the benchmark tests. I do recommend reading the results for details but just figured I'd post something that directly answered the question and bumps up ceejayoz's answer.

查看更多
登录 后发表回答