Getting error “Commands out of sync, you can't run the command now” while executing a stored procedure in mysql/PHP

后端 未结 1 1704
孤街浪徒
孤街浪徒 2020-12-17 04:57

I have written a stored procedure for a table, and after that i am executing queries for same table in php function, But i am getting error :

Error in db :          


        
相关标签:
1条回答
  • 2020-12-17 05:22

    You have to consume all selects, and navigate to next result

    $sql="";
    if (mysqli_multi_query($link, $sql)) {
        do {
            if ($result = mysqli_store_result($link)) {
                while ($row = mysqli_fetch_array($result)) {
                    array_push($arrows,$row);
                }
                mysqli_free_result($result);
            }
        } while (mysqli_next_result($link));
    }
    
    0 讨论(0)
提交回复
热议问题