fetchresultsAction
public function fetchresultsAction() {
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
//$form_data = $this->getRequest()->getPost();
//$examcatID = $form_data['examcatID'];
$examID = 'Exam_ID_001';
$Exam_Results = new Admin_Model_Examresults();
$results = $Exam_Results->fetchExamResults($examID);
foreach ($results as $value) {
print_r($value['subjectID']);
echo '<br/>';
}
}
型号&gt; Examresults
public function fetchExamResults($examID) {
$sel = $this->select();
$sel->distinct();
$sel->where('examID=?', $examID);
$result = $this->fetchAll($sel); // fetch the rows to the array called result
return $result;
}
这段代码不起作用。我需要从mysql数据库中获取subjectID的NON-Duplicate值。我怎么能这样做。请帮我解决这个问题。
注意:这是Zend 1.12版本
答案 0 :(得分:0)
尝试使用print_r($value->subjectID)