xref: /PHP-8.0/ext/mysqli/tests/039.phpt (revision e3e67b72)
1--TEST--
2function test: mysqli_num_fields() 2
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10    require_once("connect.inc");
11
12    /*** test mysqli_connect 127.0.0.1 ***/
13    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
14
15    mysqli_real_query($link, "SHOW VARIABLES");
16
17    if (mysqli_field_count($link)) {
18        $result = mysqli_store_result($link);
19        $num = mysqli_num_fields($result);
20        mysqli_free_result($result);
21    }
22
23    var_dump($num);
24
25    mysqli_close($link);
26    print "done!";
27?>
28--EXPECT--
29int(2)
30done!
31