First Php-mysql is the most primitive extension of PHP operation MySQL Database
and php-mysqli, the letter I represents the improvement, to mention the relative advanced function.
Recommend learning and using mysqli
MySQL is a non-holding connection function and Mysqli is a permanent connection function
In other words, MySQL will open a connected process each time the link
Mysqli multiple runs mysqli will use the same connection process, thus reducing the server overhead
By default, starting with PHP5, PHP does not automatically turn on MySQL support, but instead puts it into the extension function library. So the user needs to open the MySQL library in the extension function library
First open php.ini find "; Entensions=php_mysql.dll", remove the previous semicolon comment
Save restart Apache or IIS
The Phpinfo () function can then be used to check if the pairing is successful, and if the displayed PHP environment configuration information has a MySQL project, it indicates that MySQL support has been successfully turned on.
Mysqli.dll is a way of allowing the database to be manipulated as an object or a process, and it is easy to use. Here is a comparison of a few common operations and mysql.dll.
1:mysql.dll (can be understood as a functional approach):
Mysqli also have a procedural approach, but start with the mysqli prefix, the others are similar.
If Mysqli is manipulated in a procedural way, some functions must specify a resource
For example, Mysqli_query (resource Identifier, SQL statement), and the parameter of the resource identifier is placed in the preceding
The resource identifier for the mysql_query (SQL statement, optional) is placed in the back and can be unspecified, which defaults to the last open connection or resource.
And the mysql_select_db and mysqli_select_db parameters are just the opposite.
It is important to emphasize that php5.5 cannot use mysql_query and needs mysqli
That's why I came into contact with mysqli. Manual funny
2mysqli.dll (object mode):
Summary of MySQL and mysqli in PHP