A stored procedure that calls MySQL reports an error

The

CI framework calls MySQL"s stored procedure, which returns the result, but cannot render to the template. The error is as follows:
Error Number: 2014

Commands out of sync; you can"t run this command now

what is the reason for this? The
code is as follows:
$common = $this- > db- > query ("call welcome_common_data ($role_id)");
$data ["head_data"] = $common- > result_array () [0];
$this- > view (" / welcome/test",$data);

Jun.26,2021

it is possible that your stored procedure returns multiple result sets and only uses one, and a similar error will be reported when you request again

solution

 mysqli_multi_query
  while(mysqli_next_result($this->db));




Menu