I execute query of stored procudure which have 3 result of select
select _id a;
select 2 a;
select 3 a;
and I've mysqli like this to call the Stored Procedure
$i = 0;
if ($server->connection->query("CALL sp_select(1)", MYSQLI_USE_RESULT)) {
printf("res\n");
do {
$i++;
printf("$i.do\n");
if ($result = $server->connection->store_result()) {
printf("$i.store\n");
$data = $result->fetch_all(MYSQLI_ASSOC);
$this->data[] = $data;
$result->free_result();
printf("$i.free\n");
}
if ($server->connection->more_results()) {
printf("$i.more\n");
}
} while ($server->connection->next_result());
echo json_encode($this->data);
}
That function can't get stored first result. I only got second and third result. Why I can't get stored first result?