Some differences between MySQL and mysqli found on the Internet:
MySQL is a non-persistent connection function, while mysqli is a permanent connection function. That is to say
MySQL opens a connection process at each link, and mysqli runs mysqli multiple times to use the same connection process, thus reducing the server overhead.
Recently, the website has been plagued by the problem of full occupation of processes due to the increase in access traffic. Therefore, to reduce the process overhead, a set of mysqli driver is added to the mayfish framework. Next, let's take a look at how to use the mysqli driver in mayfish.
Modify the MySQL settings file in the configs directory, for example, database. php.
See the following content. This is an example of using the MySQL driver by default.
CopyCode The Code is as follows: conf ('db _ host', 'localhost ');
Conf ('db _ user', 'root ');
Conf ('db _ password', '123 ');
Conf ('db _ name', 'u112741 ');
Conf ('db _ prefix', 'mfs _');
Conf ('db _ charset', 'utf8 ');
We changed itCopy codeThe Code is as follows: conf ('driver ', 'mysqli ');
Conf ('db _ host', 'localhost ');
Conf ('db _ user', 'root ');
Conf ('db _ password', '123 ');
Conf ('db _ name', 'u112741 ');
Conf ('db _ prefix', 'mfs _');
Conf ('db _ charset', 'utf8 ');
In this case, MFs will work in mysqli mode during work.
In addition, this update also adds the error log function for database query to facilitate debugging of errors. To enable this function, modify the configs/config. php file:
Conf ("logs", true); // Add and enable the error record function (default value: True)
The latest mayfish version is: http://www.jb51.net/codes/20169.html