xref: /PHP-8.2/ext/mysqli/tests/018.phpt (revision b5a14e6c)
1--TEST--
2mysqli fetch system variables
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    /*** test mysqli_connect 127.0.0.1 ***/
14    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15
16    if (!mysqli_query($link, "SET AUTOCOMMIT=0"))
17        printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
18
19    if (!$stmt = mysqli_prepare($link, "SELECT @@autocommit"))
20        printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
21
22    mysqli_stmt_bind_result($stmt, $c0);
23    mysqli_stmt_execute($stmt);
24
25    mysqli_stmt_fetch($stmt);
26
27    var_dump($c0);
28
29    mysqli_close($link);
30    print "done!";
31?>
32--EXPECT--
33int(0)
34done!
35