xref: /PHP-8.2/ext/mysqli/tests/045.phpt (revision 05ed3b77)
1--TEST--
2mysqli_stmt_bind_result (SHOW)
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7    require_once 'skipifconnectfailure.inc';
8
9    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
10
11    $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
12    mysqli_stmt_execute($stmt);
13
14    if (!$stmt->field_count) {
15        printf("skip SHOW command is not supported in prepared statements.");
16    }
17    $stmt->close();
18    mysqli_close($link);
19?>
20--FILE--
21<?php
22    require_once "connect.inc";
23
24    /*** test mysqli_connect 127.0.0.1 ***/
25    $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
26
27    $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
28    mysqli_stmt_execute($stmt);
29
30    mysqli_stmt_bind_result($stmt, $c1, $c2);
31    mysqli_stmt_fetch($stmt);
32    mysqli_stmt_close($stmt);
33    $test = array ($c1,$c2);
34
35    var_dump($test);
36
37    mysqli_close($link);
38    print "done!";
39?>
40--EXPECTF--
41array(2) {
42  [0]=>
43  string(4) "port"
44  [1]=>
45  string(%d) "%s"
46}
47done!
48