CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 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_QUERY attribute.. The SQL statement executed was: SELECT * FROM lime_answers WHERE qid=2 AND language='en' and scale_id=0 ORDER BY sortorder, answer

/installpath/limesurvey-build130219/framework/db/CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#1
+
 /installpath/limesurvey-build130219/application/helpers/qanda_helper.php(1436): CDbCommand->query()
1431     else
1432     {
1433         $ansquery = "SELECT * FROM {{answers}} WHERE qid=$ia[0] AND language='".$_SESSION['survey_'.Yii::app()->getConfig('surveyID')]['s_lang']."' and scale_id=0 ORDER BY sortorder, answer";
1434     }
1435 
1436     $ansresult = Yii::app()->db->createCommand($ansquery)->query() or safeDie('Couldn\'t get answers<br />'.$ansquery.'<br />');    //Checked
1437     $ansresult= $ansresult->readAll();
1438     $dropdownSize = '';
1439     if (isset($aQuestionAttributes['dropdown_size']) && $aQuestionAttributes['dropdown_size'] > 0)
1440     {
1441         $_height = sanitize_int($aQuestionAttributes['dropdown_size']) ;
#2
+
 /installpath/limesurvey-build130219/application/helpers/qanda_helper.php(137): do_list_dropdown(array("2", "654567X2X2", "Organization", "What is your organization?", ...))
132                 . $clang->gT('Choose one of the following answers').'</span>';
133                 $question_text['help'] = $clang->gT('Choose one of the following answers');
134             }
135             break;
136         case '!': //List - dropdown
137             $values=do_list_dropdown($ia);
138             if ($aQuestionAttributes['hide_tip']==0)
139             {
140                 $qtitle .= "<br />\n<span class=\"questionhelp\">"
141                 . $clang->gT('Choose one of the following answers').'</span>';
142                 $question_text['help'] = $clang->gT('Choose one of the following answers');
#3
+
 /installpath/limesurvey-build130219/application/helpers/SurveyRuntimeHelper.php(672): retrieveAnswers(array("2", "654567X2X2", "Organization", "What is your organization?", ...), "654567")
667                     }
668 
669                     //Get the answers/inputnames
670                     // TMSW - can content of retrieveAnswers() be provided by LEM?  Review scope of what it provides.
671                     // TODO - retrieveAnswers is slow - queries database separately for each question. May be fixed in _CI or _YII ports, so ignore for now
672                     list($plus_qanda, $plus_inputnames) = retrieveAnswers($ia, $surveyid);
673                     if ($plus_qanda)
674                     {
675                         $plus_qanda[] = $ia[4];
676                         $plus_qanda[] = $ia[6]; // adds madatory identifyer for adding mandatory class to question wrapping div
677                         $qanda[] = $plus_qanda;
2013-02-24 14:36:54 Apache/2.2.3 (Red Hat) Yii Framework/1.1.10