青岛PHP培训
青岛达内职业培训学校

18300268127

热门课程

浅谈mysql与mysqli之区别

  • 时间:2016-08-30
  • 发布:青岛php培训
  • 来源:青岛php培训

网上搜到的一些关于mysql与mysqli的区别:

Mysql and Mysqli(Mysql Improved) are two library functions ( or Extension) in the PHP which is used to acces mysql database.Mysqli is the improved version of mysql which support OOPS. The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above.

mysql是非持继连接函数而mysqli是永远连接函数。也就是说

mysql每次链接都会打开一个连接的进程而mysqli多次运行mysqli将使用同一连接进程,从而减少了服务器的开销

如 果使用new mysqli('localhost', usenamer', 'password', 'databasename');总是报错,Fatal error: Class 'mysqli' not found in ...那么要检查一下mysqli是不是开启的。

mysqli类不是默认开启的,win下要改php.ini,去掉php_mysqli.dll前的;,linux下要把mysqli编译进去。

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. Lifted verbatim from the php.net site:

- Object-oriented interface

- Support for Prepared Statements

- Support for Multiple Statements

- Support for Transactions

- Enhanced debugging capabilities

- Embedded server support

You have the choice of using mysql, mysqli, or PDO essentially.

If you're simply looking for a relational database, you need look no further than MySQL, though there are many options available. You can use DBD, Postgres, MySQL, MSSQL, sqlite, etc etc etc...

上一篇:Google是如何对我博客的”秒”收录
下一篇:git pull代码

青岛PHP培训:服务端渲染

如何在Linux环境下安装PHP

学习PHP的正确姿势

PHP基础问题解惑

选择城市和中心
贵州省

广西省

海南省

达内教育

有位老师想和您聊一聊