CDbException

CDbException

خطای CDbCommand در اجرای SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '0000-00-00' for column 'expiration_date' at row 1. The SQL statement executed was: UPDATE `content` SET `id`=:yp0, `language`=:yp1, `user_id`=:yp2, `type_content`=:yp3, `toptitle`=:yp4, `title`=:yp5, `subtitle`=:yp6, `introtext`=:yp7, `fulltext`=:yp8, `image`=:yp9, `source`=:yp10, `redirect`=:yp11, `creation_date`=:yp12, `creation_time`=:yp13, `expiration_date`=:yp14, `layout_id`=:yp15, `comment_status`=:yp16, `comment_count`=:yp17, `visitors`=:yp18, `ordering`=:yp19, `rating`=:yp20, `status`=:yp21 WHERE `content`.`id`='386'

/home2/bmathir/public_html/framework/db/CDbCommand.php(354)

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

Stack Trace

#3
+
 /home2/bmathir/public_html/protected/modules/content/controllers/ContentController.php(552): CActiveRecord->save()
547      * Manages all models.
548      */
549     private function countVisitors($model)
550     {
551         $model->visitors++;
552         $model->save();
553     }
554     
555     ////////////////////////////////////////////////
556     public function actionSendFreinds($id){
557         Yii::app()->theme=$this->themeName;
#4
+
 /home2/bmathir/public_html/protected/modules/content/controllers/ContentController.php(625): ContentController->countVisitors(Content)
620         //=============================================
621         $content=$this->loadModel($id);
622         Yii::app()->params['layoutId']=$content->layout_id;
623         if ($content->status!='publish' && !Yii::app()->user->isAdmin() && !Yii::app()->user->isAuthor() && !Yii::app()->user->isEditor())
624         throw new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));
625         $this->countVisitors($content);
626         $this->render('display',array('content'=>$content));
627     }
628     
629     public function actionArchive()
630     {
#19
+
 /home2/bmathir/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 require_once($yii);
12 
13 Yii::createWebApplication($config)->run();
2018-09-25 16:41:54 Apache Yii Framework/1.1.10