CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near '`'.. The SQL statement executed was: SELECT COUNT(*) FROM [dbo].[lime_survey_761276] [t] LEFT JOIN lime_tokens_761276 tokens ON t.token = tokens.token WHERE `submitdate` IS NOT NULL

C:\etc\Apache\htdocs\MSSQL\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

#2
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\admin\responses.php(507): CActiveRecord->count(CDbCriteria)
502             elseif (incompleteAnsFilterState() == "complete")
503             {
504                 $oCriteria->addCondition("`submitdate` IS NOT NULL");
505             }
506 
507             $dtcount = Survey_dynamic::model($iSurveyID)->count($oCriteria);// or die("Couldn't get response data<br />");
508 
509             if ($limit > $dtcount)
510             {
511                 $limit = $dtcount;
512             }
#5
+
 C:\etc\Apache\htdocs\MSSQL\application\core\Survey_Common_Action.php(82): CAction->runWithParamsInternal(responses, ReflectionMethod, array("surveyid" => "761276", "sa" => "browse", "iSurveyId" => "761276", "iSurveyID" => "761276"))
77             $oMethod = new ReflectionMethod($this, $sDefault);
78         }
79 
80         // We're all good to go, let's execute it
81         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82         return parent::runWithParamsInternal($this, $oMethod, $params);
83     }
84 
85     /**
86     * Some functions have different parameters, which are just an alias of the
87     * usual parameters we're getting in the url. This function just populates
#9
+
 C:\etc\Apache\htdocs\MSSQL\application\controllers\AdminController.php(159): CController->run("responses")
154                 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
155 
156                 $this->redirect($this->createUrl('/admin/authentication/login'));
157             }
158 
159             return parent::run($action);
160     }
161 
162     /**
163     * Routes all the actions to their respective places
164     *
2012-11-05 09:18:59 Apache/2.4.3 (Win32) PHP/5.4.8 Yii Framework/1.1.10