doudui1850 2015-05-18 05:17
浏览 84
已采纳

在Phalcon中其他未缓冲的查询处于活动状态时,无法执行查询

I have gone through lots of post from StackOverflow and other sites. Following is the solution which I found almost on all sites But its not working for me. :-

     return new \Phalcon\Db\Adapter\Pdo\MySql(array(
            "host"     => 'XXXx',
            "username" => 'XXXX',
            "password" => 'XXXX',
            "dbname"   => 'XXXX',
            "options"  => array(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)
        ));

My code for calling Store Procedures:

    public function AssignPromoterToPromotionVenuAction($bookingSheetID = 0, $promoter_id = 0, $userID = 0)
    {
        $query = "CALL `x_wf_AgencyAssignPromoter`($bookingSheetID, $promoter_id, $userID)";
        $rp = new Promotion();
        return new Resultset(null, $rp, $rp->getReadConnection()->query($query));
    }

    public function RemovePromoterToPromotionVenuAction($bookingSheetID = 0, $promoter_id = 0, $userID = 0)
    {
        $query = "CALL `x_wf_AgencyRemovePromoter`($bookingSheetID, $promoter_id, $userID)";      
        $rp = new Promotion();
        return new Resultset(null, $rp, $rp->getReadConnection()->query($query));
    }
  • 写回答

1条回答 默认 最新

  • douqiao3930 2015-05-19 08:55
    关注

    Finally got the solution :

    instead of returning a Resultset you can fetch the result of calling the procedure:

     return $rp->getReadConnection()->query($query)->fetchAll();
    

    Ref Link

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
  • ¥100 H5网页如何调用微信扫一扫功能?
  • ¥15 讲解电路图,付费求解