其他无缓冲查询处于活动状态时无法执行查询

其他无缓冲查询处于活动状态时无法执行查询

本文介绍了HY000 - 2014 - 当其他无缓冲查询处于活动状态时无法执行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

语句无法执行(HY000 - 2014 - 其他无缓冲查询处于活动状态时无法执行查询.考虑使用 PDOStatement::fetchAll().或者,如果您的代码只针对 mysql 运行,您可以启用查询通过设置 PDO::MYSQL_ATTR_USE_BUFFERED 进行缓冲 我在 zf2 中运行操作时遇到此错误,如何解决此问题

Statement could not be executed (HY000 - 2014 - Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED i got this error while running an action in zf2, how to solve this issue

{$assSub=$this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId);

{$assSub=$this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId);

$request = $this->getRequest();

$request = $this->getRequest();

    if($request->isPost()){
       $submittedArray = $request->getPost()->toArray();
       $remarks = $submittedArray['remark'];
       $grades  = $submittedArray['grade'];
       $submittedChk =$submittedArray['submitted'];
       foreach ($submittedChk as $submitted){
             $chksubmitted = 1;
             $remark = $remarks[$submitted];
             $grade  = $grades[$submitted];
                $submittedObj =  new TblInstitutesDepartmentModel(array('asid' => $sub,'gd_id' => $grd,'rem' => $rem,'is_sub' => $chksub,'sub_date'=>date('Y-m-d')));
                $this->getTblInstitutesDepartmentsTable()->updateAssigned($submittedObj);        }
    }
    $view = new ViewModel(array(
        'assStd'  => $assSub,
        'flashMessages'     => $this->flashMessenger()->getMessages()
            )
    );

推荐答案

我只是调用 $this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId) 这个来查看模型

i just call $this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId) this to view model

//$assSub=$this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId);

$request = $this->getRequest();
if($request->isPost()){

$request = $this->getRequest();
if($request->isPost()){

   $submittedArray = $request->getPost()->toArray();

   $remarks = $submittedArray['remark'];

   $grades  = $submittedArray['grade'];

   $submittedChk =$submittedArray['submitted'];

   foreach ($submittedChk as $submitted){

         $chksubmitted = 1;

         $remark = $remarks[$submitted];

         $grade  = $grades[$submitted];

            $submittedObj =  new TblInstitutesDepartmentModel(array('asid' => $sub,'gd_id' => $grd,'rem' => $rem,'is_sub' => $chksub,'sub_date'=>date('Y-m-d')));

            $this->getTblInstitutesDepartmentsTable()->updateAssigned($submittedObj);        }
}
$view = new ViewModel(array(
    //'assStd'  => **$assSub**,
      'assStd'  =>  $this->getTblInstitutesDepartmentsTable()->getAssignedDetails($urlassId),
    'flashMessages'     => $this->flashMessenger()->getMessages()
        )
);

这篇关于HY000 - 2014 - 当其他无缓冲查询处于活动状态时无法执行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 07:20