运行存储过程时命令不同步!使用mysqli驱动程序 [英] Command out of sync when i run stored procedure! using mysqli driver

查看:47
本文介绍了运行存储过程时命令不同步!使用mysqli驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mysqli驱动程序。

I am Using Mysqli Driver.

当我尝试运行存储过程时,命令不同步。我已经尝试过

I am getting Command out of sync when i try to run the stored procedure. I have tried

free_result();

这是我的代码段,任何一个都可以告诉我解决方案吗?

this is the snippet of my code can any 1 tell me the solution?

function block()
{
    $qry = "CALL `sp_get_codes_by_block_id`(?)";
    $result = $this->db->query($qry, $this->getBlockId());
    $temp_array = array();
    $temp_array = $result;
    $result->free_result();
    return $result->result_array();
}


推荐答案

好吧,我实际上已经找到答案了

well i Actually figured out answer after alot of Brain storming and search.

   $qry = "CALL `sp_get_codes_by_block_id`(?)";
    $result = $this->db->query($qry, $this->getBlockId());
    mysqli_next_result($this->db->conn_id);
    return $result->result_array();

这篇关于运行存储过程时命令不同步!使用mysqli驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆