CDbException

CDbCommand не удалось исполнить SQL-запрос: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1711676372' for key 'uniqid'. The SQL statement executed was: INSERT INTO `visitors` (`creation_date`, `uniqid`, `user_agent`, `ip`, `referrer`, `utm_source`, `utm_campaign`, `utm_medium`, `utm_term`, `utm_content`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9). Bound with :yp0='2024-03-29 03:04:32', :yp1='1711676372', :yp2='claudebot', :yp3='54.163.200.109', :yp4='', :yp5='', :yp6='', :yp7='', :yp8='', :yp9=''

/home/c/ct50414/public_html/framework/db/CDbCommand.php(357)

345         {
346             if($this->_connection->enableProfiling)
347                 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
348 
349             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
350             $message=$e->getMessage();
351             Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
352                 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
353 
354             if(YII_DEBUG)
355                 $message.='. The SQL statement executed was: '.$this->getText().$par;
356 
357             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
358                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
359         }
360     }
361 
362     /**
363      * Executes the SQL statement and returns query result.
364      * This method is for executing an SQL query that returns result set.
365      * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative
366      * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
367      * them in this way can improve the performance. Note that if you pass parameters in this way,
368      * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
369      * Please also note that all values are treated as strings in this case, if you need them to be handled as

Stack Trace

#2
+
 /home/c/ct50414/public_html/application/protected/components/DefaultController.php(137): CActiveRecord->save()
132         $visitor->utm_source = isset($_GET['utm_source']) ? $_GET['utm_source'] : '';
133         $visitor->utm_campaign = isset($_GET['utm_campaign']) ? $_GET['utm_campaign'] : '';
134         $visitor->utm_medium = isset($_GET['utm_medium']) ? $_GET['utm_medium'] : '';
135         $visitor->utm_term = isset($_GET['utm_term']) ? $_GET['utm_term'] : '';
136         $visitor->utm_content = isset($_GET['utm_content']) ? $_GET['utm_content'] : '';
137         $visitor->save();
138         $_SESSION['visitor_id'] = $visitor->id;
139     }
140 
141 
142     protected function createSeo(RActiveRecord $model){
#3
+
 /home/c/ct50414/public_html/application/protected/components/DefaultController.php(98): DefaultController->createCookie()
093     protected function checkVisitor(){
094 
095         /** Первый вход */
096         if(!isset($_SESSION['visitor_id'])){
097             if(!isset($_COOKIE['visitor_uid'])){
098                 self::createCookie();
099             }else{
100                 $visitor = self::findVisitor();
101                 if($visitor) {
102                     $_SESSION['visitor_id'] = $visitor->id;
103                 }else{
#4
+
 /home/c/ct50414/public_html/application/protected/components/DefaultController.php(87): DefaultController->checkVisitor()
82 
83         Yii::app()->language = 'ru';
84 
85         @session_start();
86 
87         self::checkVisitor();
88 
89         parent::init();
90     }
91 
92 
2024-03-29 03:04:32 Apache/2.4.29 Yii Framework/1.1.13