Home >Web Front-end >JS Tutorial >How to make mayfish support mysqli database driver_javascript skills
Some differences between mysql and mysqli found on the Internet:
mysql is a non-persistent connection function and mysqli is a permanent connection function. That is to say
mysql will open a connection process for each connection, and mysqli will use the same connection process if you run mysqli multiple times, thus reducing the server overhead
Because in recent times, the website has also experienced a huge increase in the number of visits. has been increasing, but has been troubled by the problem of process being full. Therefore, in order to reduce process overhead, a set of mysqli drivers were added to the mayfish framework. Next, let’s take a look at how to use the mysqli driver to work under mayfish.
In the configs directory, modify the mysql setting file, for example: database.php
See the following content. This is an example of using the mysql driver by default.