1--TEST--
2function test: mysqli_field_count()
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
8mysqli_check_skip_test();
9?>
10--FILE--
11<?php
12require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
13
14    $link = default_mysqli_connect();
15
16    mysqli_query($link, "CREATE TABLE test_mysqli_field_count (a int, b varchar(10)) ENGINE = " . get_default_db_engine());
17
18    mysqli_query($link, "INSERT INTO test_mysqli_field_count VALUES (1, 'foo')");
19    $ir[] = mysqli_field_count($link);
20
21    mysqli_real_query($link, "SELECT * FROM test_mysqli_field_count");
22    $ir[] = mysqli_field_count($link);
23
24
25    var_dump($ir);
26
27    mysqli_close($link);
28    print "done!";
29?>
30--CLEAN--
31<?php
32require_once(dirname(__DIR__) . "/test_setup/test_helpers.inc");
33tear_down_table_on_default_connection('test_mysqli_field_count');
34?>
35--EXPECT--
36array(2) {
37  [0]=>
38  int(0)
39  [1]=>
40  int(2)
41}
42done!
43