xref: /PHP-8.0/ext/mysqli/tests/017.phpt (revision e3e67b72)
1--TEST--
2mysqli fetch functions
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    if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
16        printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
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 !== $db) {
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