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

前端 未结 21 2554
庸人自扰
庸人自扰 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:08

    I think the problem is that you're making a new connection in the function, and then not closing it at the end. Why don't you try passing in the existing connection and re-using it?

    Another possibility is that you're returning out of the middle of a while loop fetching. You never complete that outer fetch.

提交回复
热议问题