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

前端 未结 21 2551
庸人自扰
庸人自扰 2020-11-21 11:35

I am trying to execute my PHP code, which calls two MySQL queries via mysqli, and get the error \"Commands out of sync; you can\'t run this command now\".

Here is th

21条回答
  •  北恋
    北恋 (楼主)
    2020-11-21 12:04

    I had today the same problem, but only when working with a stored procedure. This make the query behave like a multi query, so you need to "consume" other results available before make another query.

    while($this->mysql->more_results()){
        $this->mysql->next_result();
        $this->mysql->use_result();
    }
    

提交回复
热议问题