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

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

    My problem was that I was using first prepare statement and then I was using mysqli query on the same page and was getting the error "Commands out of sync; you can't run this command now". The error was only then when I was using the code that had prepare statement.

    What I did was to close the question. and it worked.

    mysqli_stmt_close($stmt);

    My code

    get_category.php (here using prepare statement )

        

    admin_get_category_body.php (here mysqli)

            
    
            
    
            

    Ctegories

    Category Name

    Edit

    Delete

    Edit Delete

    Something that just crossed my mind, I am also again adding connection variable via global $connection;. So I think basically a whole new set of query system is being started after ending of prepare statement with mysqli_stmt_close($stmt); and also I am adding these files and other stuff via include

提交回复
热议问题