Foreword: PHP is a programming language that is relatively easy to get started with, and PHP has a lot of built-in functions. Therefore, it is particularly important to understand and master these built-in functions. Next we will analyze some of the built-in functions of PHP.
I will continue to organize it for you in the future.
Recommend php video tutorial:php tutorial
Recommend mysql video tutorialmysql
Understanding of phpMysqli function:
1. What is php mysqli?
php mysqli = php nysqli improved
The mysqli function allows you to access the database server.
Notice! The mysqli extension is available for mysqli version 4.1.13 or newer.
2. How to use mysqli function?
If you want to use the mysqli function, you must add support for the mysqli extension when compiling php.
For more information about installation, please visit:Installation address visit
For more information about running configuration address:Running configuration visit
3. PHP mysqli function introduction
1.mysqli_connect(host,username,password,dbname,port,socket)
Description : Open a new connection to the mysql server. What is returned is a connection object representing the database.
Example:
2、mysqli_connect_error()
Description: The function returns the error description of the last connection error. What is returned is a string describing the error, or NULL if no error occurs.
Example:
3,mysqli_errno(connection)
Description: The function returns the last error of the most recently called function code. If there is no error, return 0
Example:
4,mysqli_connect_errno()
Description: The function returns the last time The error code of the connection, or 0 if there is no error.
Example:
5、mysqli_close(connection);
Description: Close the previously opened database connection.
Example:
The above are the uses of some functions that I have collected for you. I will continue to organize the functions for you in the future to increase your memory of the functions. Thanks!
The above is the detailed content of Some organization and detailed introduction about PHP Mysqli functions (1). For more information, please follow other related articles on the PHP Chinese website!