xref: /PHP-7.3/ext/mysqli/tests/069.phpt (revision b746e698)
1--TEST--
2mysqli multi_query, next_result, more_results
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10	require_once("connect.inc");
11
12	$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
13	$mysql->multi_query('SELECT 1;SELECT 2');
14	do {
15		$res = $mysql->store_result();
16		if ($mysql->errno == 0) {
17			while ($arr = $res->fetch_assoc()) {
18				var_dump($arr);
19			}
20			$res->free();
21		}
22		if (!$mysql->more_results()) {
23			break;
24		}
25	} while (@$mysql->next_result());
26	$mysql->close();
27	print "done!";
28?>
29--EXPECT--
30array(1) {
31  [1]=>
32  string(1) "1"
33}
34array(1) {
35  [2]=>
36  string(1) "2"
37}
38done!
39