xref: /PHP-7.3/ext/mysqli/tests/017.phpt (revision b746e698)
1--TEST--
2mysqli fetch functions
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifemb.inc');
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