CDbException

CDbCommand konnte das SQL-Statement nicht ausführen: SQLSTATE[HY000]: General error: 1364 Field 'datum' doesn't have a default value. The SQL statement executed was: INSERT INTO `recipe_downloads` (`region`, `city`, `country`) VALUES (:yp0, :yp1, :yp2)

/var/www/vhosts/zainoo.com/httpdocs/protected/framework/db/CDbCommand.php(358)

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

Stack Trace

#2
+
 /var/www/vhosts/zainoo.com/httpdocs/protected/controllers/RecipeController.php(63): CActiveRecord->save()
58       $stat->region = isset($recipe->region) ? $recipe->region->id : 0;
59       $stat->city = isset($recipe->city) ? $recipe->city->id : 0;
60       $stat->country = isset($recipe->country) ? $recipe->country->id : 0;
61       //$stat->datum = (string)date('Y-m-d');
62 
63       $stat->save();
64       
65       
66       spl_autoload_unregister(array('YiiBase','autoload')); 
67       
68       require_once($_SERVER{'DOCUMENT_ROOT'}."/protected/extensions/pdf/dompdf_config.inc.php");
#3
+
 /var/www/vhosts/zainoo.com/httpdocs/protected/controllers/RecipeController.php(24): RecipeController->actionPDF()
19     }
20     
21     public function actionDetail() {
22       
23       if(isset($_GET{'pdf'})) {
24         $this->actionPDF();
25       }
26       
27       $this->layout = 'region';
28 
29       $recipe = isset($GLOBALS{'recipe'}) ? $GLOBALS{'recipe'} : ARRecipe::model()->findByUrl($_GET{'url'});
#10
+
 /var/www/vhosts/zainoo.com/httpdocs/protected/controllers/UrlController.php(95): CController->forward("recipe/detail")
090           } elseif($GLOBALS{'tour'}) {
091             $this->checkLocation($GLOBALS{'tour'});
092             $this->forward('tours/detail');
093           } elseif($GLOBALS{'recipe'}) {
094             $this->checkLocation($GLOBALS{'recipe'});
095             $this->forward('recipe/detail');
096           } elseif($GLOBALS{'hotel'}) {
097             $this->checkLocation($GLOBALS{'hotel'});
098             $this->forward('hotels/detail');
099           }
100        }
2024-03-28 23:26:43 Apache Yii Framework/1.1.17