Some of the differences between MySQL and mysqli are found on the Internet:
MySQL is a non-holding relay function and MYSQLI is a permanent connection function. Other words
MySQL each link will open a connected process and mysqli run mysqli multiple times will use the same connection process, thereby reducing the cost of the server
Because of the recent time, the site also because of the increase in traffic, and has been the process occupied by the problem. Therefore, in order to reduce the overhead of the process, a set of mysqli drivers are added for the mayfish framework. Let's take a look at how to work with the mysqli driver under Mayfish.
In the Configs directory, modify the MySQL settings file, for example: database.php
See the following, this is a default use of MySQL driver example.
Copy Code code as follows:
Conf (' db_host ', ' localhost ');
Conf (' Db_user ', ' root ');
Conf (' Db_password ', ' 123456 ');
Conf (' db_name ', ' u112741 ');
Conf (' Db_prefix ', ' mfs_ ');
Conf (' db_charset ', ' UTF8 ');
We will change him into
Copy Code code as follows:
Conf (' Driver ', ' mysqli ');
Conf (' db_host ', ' localhost ');
Conf (' Db_user ', ' root ');
Conf (' Db_password ', ' 123456 ');
Conf (' db_name ', ' u112741 ');
Conf (' Db_prefix ', ' mfs_ ');
Conf (' db_charset ', ' UTF8 ');
In this case, MFS will work in a mysqli way when he is at work.
At the same time, the update also added to the database query error logging function to facilitate debugging errors. The Open method is: Modify the configs/config.php file:
Conf ("Logs", true); Add open error logging feature (default: TRUE)
The latest version of Mayfish's download address is: http://www.jb51.net/codes/20169.html