MySQL stored procedure caused `Commands out of sync`

前端 未结 4 1539
余生分开走
余生分开走 2020-12-16 04:11

Call procedure works all right in MySQL terminal, but in PHP, caused Commands out of sync; you can\'t run this command nowCommands out of sync; you can\'t run this com

4条回答
  •  长情又很酷
    2020-12-16 04:50

    i know it is late and there is already an answer, but i was getting the same message for a whole different reason, so i will leave my solution here:

    it was actually a very silly error. It was just a typo in a parameter name. My function had a parameter named preferable:

    create function call_client (pereferable int, client_id int) returns int 
    

    in the function body, i was using the parameter preferable with the wrong name:

    if prefered  = 1 then
      ...
    end if;
    

    once i changed prefered for preferable it started working again.

提交回复
热议问题