1--TEST--
2mysqli fetch integer values
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    // To get consistent result without depending on the DB version/setup
17    mysqli_query($link, "SET sql_mode=''");
18
19    mysqli_query(
20        $link,
21        "CREATE TABLE test_bind_fetch_integers(
22            c1 int unsigned,
23            c2 int unsigned,
24            c3 int,
25            c4 int,
26            c5 int,
27            c6 int unsigned,
28            c7 int
29        ) ENGINE=" . get_default_db_engine()
30    );
31
32    mysqli_query($link, "INSERT INTO test_bind_fetch_integers VALUES (-23,35999,NULL,-500,-9999999,-0,0)");
33
34    $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_integers");
35    mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
36    mysqli_stmt_execute($stmt);
37    mysqli_stmt_fetch($stmt);
38
39    $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
40
41    var_dump($test);
42
43    mysqli_stmt_close($stmt);
44    mysqli_close($link);
45    print "done!";
46?>
47--CLEAN--
48<?php
49require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
50tear_down_table_on_default_connection('test_bind_fetch_integers');
51?>
52--EXPECT--
53array(7) {
54  [0]=>
55  int(0)
56  [1]=>
57  int(35999)
58  [2]=>
59  NULL
60  [3]=>
61  int(-500)
62  [4]=>
63  int(-9999999)
64  [5]=>
65  int(0)
66  [6]=>
67  int(0)
68}
69done!
70