Some organization and detailed introduction about PHP Mysqli functions (1)

王林
Release: 2023-04-07 07:32:01
Original
3617 people have browsed it

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:

Copy after login

Some organization and detailed introduction about PHP Mysqli functions (1)

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:

Copy after login

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:

Copy after login

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:

Copy after login

Some organization and detailed introduction about PHP Mysqli functions (1)

5、mysqli_close(connection);

Description: Close the previously opened database connection.

Example:

Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!