xref: /PHP-8.1/ext/mysqli/tests/039.phpt (revision b5a14e6c)
1--TEST--
2function test: mysqli_num_fields() 2
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    mysqli_real_query($link, "SHOW VARIABLES");
17
18    if (mysqli_field_count($link)) {
19        $result = mysqli_store_result($link);
20        $num = mysqli_num_fields($result);
21        mysqli_free_result($result);
22    }
23
24    var_dump($num);
25
26    mysqli_close($link);
27    print "done!";
28?>
29--EXPECT--
30int(2)
31done!
32