0

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

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

$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()
            )
    );
4

1 回答 1

0

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

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

$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()
        )
);
于 2015-03-19T18:10:01.097 回答