Definition and usage
mysqli_autocommit() function turns on or off automatic submission of database modifications.
Tip: Please take a look at the mysqli_commit() function, which is used to commit the current transaction for the specified database connection. Please see the mysqli_rollback() function for rolling back the current transaction.
Syntax
mysqli_autocommit(connection,mode);
Technical details
Example
Turn off autocommit, do some queries, and then submit the query:
<?php // 假定數(shù)據(jù)庫(kù)用戶名:root,密碼:123456,數(shù)據(jù)庫(kù):RUNOOB $con=mysqli_connect("localhost","root","123456","RUNOOB"); if (mysqli_connect_errno($con)) { echo "連接 MySQL 失敗: " . mysqli_connect_error(); } // 關(guān)閉自動(dòng)提交 mysqli_autocommit($con,FALSE); // 插入一些值 mysqli_query($con,"INSERT INTO websites (name, url, alexa, country) VALUES ('百度','https://www.baidu.com/','4','CN')"); // 提交事務(wù) mysqli_commit($con); // 關(guān)閉連接 mysqli_close($con); ?>

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
