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));




MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e51004-44937.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e51004-44937.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?