CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'current_timestamp()' for column `nic_club`.`2014_users`.`add_date` at row 1. The SQL statement executed was: INSERT INTO `2014_users` (`add_date`, `token`, `status`, `answers_data`) VALUES (:yp0, :yp1, :yp2, :yp3). Bound with :yp0='current_timestamp()', :yp1='68ce6bf26158005acfa0686c3ed1318d', :yp2=5, :yp3='[]'

/home/nicua/club.nic.ua/public_html/yii.1.1.13/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/nicua/club.nic.ua/public_html/2014/protected/models/Users.php(128): CActiveRecord->save()
123         
124         if (!$userModel) {
125             $userModel=new Users();
126             $userModel->token=md5(time().' '.rand(1000000, 9999999));
127             $userModel->status=Users::StatusNew;
128             $userModel->save();
129             
130             setcookie($cookieName, $userModel->token, time()+3600*24*60, '/');
131         }
132         
133         return $userModel;
#3
+
 /home/nicua/club.nic.ua/public_html/2014/protected/components/FrontEndController.php(24): Users::getByToken()
19     
20     
21     public function init() {
22         parent::init();
23         
24         $this->user=Users::getByToken();
25         
26         /*if (isset($_SESSION['user_token'])) {
27             $this->user=Users::model()->find('token=:token', array('token'=>$_SESSION['user_token']));
28             unset($_SESSION['user_token']);
29         }
#7
+
 /home/nicua/club.nic.ua/public_html/2014/protected/behaviors/WebApplicationEndBehavior.php(42): CApplication->run()
37         $this->_endName = $name;
38         
39         $this->onModuleCreate = array($this, 'changeModulePaths');
40         $this->onModuleCreate(new CEvent ($this->owner));
41 
42         $this->owner->run();
43     }
44 
45     /**
46      * onModuleCreate
47      *
2024-03-19 05:59:14 nginx/1.20.1 Yii Framework/1.1.13