mysqli_autocommit
Turns on or off auto-commiting database modifications
Description
boolmysqli_autocommit
objectlink
boolmode
mysqli_autocommit is used to turn on or off auto-commit mode
on queries for the database connection represented by the link
resource.
&return.success;
mysqli_autocommit doesn't work with non transactional
table types (like MyISAM or ISAM).
To determine the current state of autocommit use the SQL command
'SELECT @@autocommit'.
Using the mysqli_autocommit function
Procedural style:
]]>
Object oriented style:
autocommit(true);
/* determine current autocommit status */
if ($result = $mysql->query($link, "SELECT @@autocommit")) {
$row = $result->fetch_row($result);
printf ("Autocommit is %d\n", $row[0]);
$result->free();
}
/* close connection */
$mysql->close();
?>
]]>
The above examples would produce the following output:
See also mysqli_commit,
mysqli_rollback.