1--TEST--
2mysqli fetch MySQL functions
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    $stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'");
17
18    mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
19    mysqli_stmt_execute($stmt);
20
21    mysqli_stmt_fetch($stmt);
22    mysqli_stmt_close($stmt);
23
24    $test = array($c0, $c1, $c2);
25    if ($c1 !== get_default_database()) {
26        echo "Different data\n";
27    }
28
29    var_dump($test);
30    mysqli_close($link);
31    print "done!";
32?>
33--EXPECTF--
34array(3) {
35  [0]=>
36  string(32) "37b51d194a7513e45b56f6524f2d51f2"
37  [1]=>
38  string(%d) "%s"
39  [2]=>
40  string(3) "foo"
41}
42done!
43