CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[22018]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Conversion failed when converting the varchar value '{SITENAME}' to data type int.. The SQL statement executed was: SELECT q.* , group_name, group_order FROM lime_questions q, [lime_groups] g, lime_question_attributes qa
WHERE g.gid = q.gid AND g.language = :lang1 AND q.language = :lang2 AND q.sid = :surveyid AND q.qid = qa.qid AND q.parent_qid = 0 AND qa.attribute = 'public_statistics' AND CAST(CAST(qa.value as varchar) as int)='1'

E:\WebSite\limesurvey\framework\db\CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#1
+
 E:\WebSite\limesurvey\application\controllers\Statistics_userController.php(158): CDbCommand->queryAll()
153         } else {
154             $query .= " AND qa.value='1'\n";
155         }
156 
157         //execute query
158         $result = Yii::app()->db->createCommand($query)->bindParam(":lang1", $sLanguage, PDO::PARAM_STR)->bindParam(":lang2", $sLanguage, PDO::PARAM_STR)->bindParam(":surveyid", $iSurveyID, PDO::PARAM_INT)->queryAll();
159 
160         //store all the data in $rows
161         $rows = $result;
162 
163 
#11
+
 E:\WebSite\limesurvey\index.php(194): CApplication->run()
189 require_once APPPATH . 'core/LSYii_Application' . EXT;
190 
191 $config = require_once(APPPATH . 'config/internal' . EXT);
192 
193 Yii::$enableIncludePath = false;
194 Yii::createApplication('LSYii_Application', $config)->run();
195 
196 /* End of file index.php */
197 /* Location: ./index.php */
2022-03-11 08:28:49 Microsoft-IIS/10.0 Yii Framework/1.1.24-dev