Summary and detailed introduction of php mysqli function (2)

王林
Release: 2023-04-07 07:34:02
Original
2270 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.

Recommended php video tutorial: //m.sbmmt.com/course/list/29/type/2.html

Understanding of phpMysqli functions:

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: http://www.php.net/manual/en/mysqli.installation.php

For details about running configuration Detailed information address: http://www.php.net/manual/en/mysqli.configuration.php

3. Function introduction:

1, mysqli_query(connection, query, resultmode)Function

resultmode parameter is optional, any one of the following

MYSQLI_STORE_RESULT (Default)

MYSLQLI_USE_RESULT(Available for retrieving large amounts of data)

Description: Execute sql statement

Instance:

Copy after login

2, mysqli_affected_rows()Function

Description: Output the affected rows from different queries Record number of rows:

Instance:

Copy after login

3mysqli_autocommit()Function

Description: Turn off or enable automatic data submission

Instance:

Copy after login

4, mysqli_commit()Function

Description: After turning off automatic submission, manually submit the current transaction transaction of the specified database connection

Instance:

Copy after login

5, mysqli_rollback()Function

Description: Turn off automatic submission, manually commit the transaction, and roll back the current transaction.

Returns true if successful, otherwise returns false.

Example:

Copy after login

The above is a supplement to the mysqli function, I hope it will be helpful to everyone. Thanks!

Recommended related articles: //m.sbmmt.com/php-weizijiaocheng-428624.html

The above is the detailed content of Summary and detailed introduction of php mysqli function (2). 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 [email protected]
Popular Tutorials
More>
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!