xref: /PHP-8.1/ext/mysqli/tests/017.phpt (revision b5a14e6c)
1--TEST--
2mysqli fetch functions
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    /*** test mysqli_connect 127.0.0.1 ***/
14    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15
16    if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
17        printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
18
19    mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
20    mysqli_stmt_execute($stmt);
21
22    mysqli_stmt_fetch($stmt);
23    mysqli_stmt_close($stmt);
24
25    $test = array($c0, $c1, $c2);
26    if ($c1 !== $db) {
27        echo "Different data\n";
28    }
29
30    var_dump($test);
31    mysqli_close($link);
32    print "done!";
33?>
34--EXPECTF--
35array(3) {
36  [0]=>
37  string(32) "37b51d194a7513e45b56f6524f2d51f2"
38  [1]=>
39  string(%d) "%s"
40  [2]=>
41  string(3) "foo"
42}
43done!
44