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 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿