xref: /PHP-8.1/ext/mysqli/tests/074.phpt (revision b5a14e6c)
1--TEST--
2mysqli_autocommit() tests
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11
12    require_once("connect.inc");
13
14    $mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
15
16    var_dump($mysqli->autocommit(false));
17    $result = $mysqli->query("SELECT @@autocommit");
18    var_dump($result->fetch_row());
19
20    var_dump($mysqli->autocommit(true));
21    $result = $mysqli->query("SELECT @@autocommit");
22    var_dump($result->fetch_row());
23
24?>
25--EXPECT--
26bool(true)
27array(1) {
28  [0]=>
29  string(1) "0"
30}
31bool(true)
32array(1) {
33  [0]=>
34  string(1) "1"
35}
36