Hi, big newbie here. Following chapter 5 of the book and while creating projects using the tests worked for me, when I try to create a new project using CRUD by typing a project name and description in the form and leaving the rest blank I get the following error:
CDbException
Description
CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘’ for column ‘create_time’ at row 1
Source File
C:\localhost\htdocs\yii\framework\db\CDbCommand.php(234)
00222: if($this->_connection->enableProfiling)
00223: Yii::endProfile(‘system.db.CDbCommand.execute(’.$this->getText().’)’,‘system.db.CDbCommand.execute’);
00224:
00225: return $n;
00226: }
00227: catch(Exception $e)
00228: {
00229: if($this->_connection->enableProfiling)
00230: Yii::endProfile(‘system.db.CDbCommand.execute(’.$this->getText().’)’,‘system.db.CDbCommand.execute’);
00231: Yii::log('Error in executing SQL: '.$this->getText().$par,CLogger::LEVEL_ERROR,‘system.db.CDbCommand’);
00232: $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
00233:
00234: throw new CDbException(Yii::t(‘yii’,‘CDbCommand failed to execute the SQL statement: {error}’,
00235: array(’{error}’=>$e->getMessage())),(int)$e->getCode(),$errorInfo);
00236: }
00237: }
00238:
00239: /**
00240: * Executes the SQL statement and returns query result.
00241: * This method is for executing an SQL query that returns result set.
00242: * @param array input parameters (name=>value) for the SQL execution. This is an alternative
00243: * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
00244: * them in this way can improve the performance. Note that you pass parameters in this way,
00245: * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
00246: * binding methods and the input parameters this way can improve the performance.
Stack Trace
#0 C:\localhost\htdocs\yii\framework\db\ar\CActiveRecord.php(1000): CDbCommand->execute()
#1 C:\localhost\htdocs\yii\framework\db\ar\CActiveRecord.php(759): CActiveRecord->insert(NULL)
#2 C:\localhost\htdocs\trackstar\protected\controllers\TblProjectController.php(72): CActiveRecord->save()
#3 C:\localhost\htdocs\yii\framework\web\actions\CInlineAction.php(50): TblProjectController->actionCreate()
#4 C:\localhost\htdocs\yii\framework\web\CController.php(300): CInlineAction->run()
#5 C:\localhost\htdocs\yii\framework\web\filters\CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#6 C:\localhost\htdocs\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
#7 C:\localhost\htdocs\yii\framework\web\CController.php(1049): CFilter->filter(Object(CFilterChain))
#8 C:\localhost\htdocs\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
#9 C:\localhost\htdocs\yii\framework\web\filters\CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#10 C:\localhost\htdocs\yii\framework\web\CController.php(283): CFilterChain->run()
#11 C:\localhost\htdocs\yii\framework\web\CController.php(257): CController->runActionWithFilters(Object(CInlineAction), Array)
#12 C:\localhost\htdocs\yii\framework\web\CWebApplication.php(324): CController->run(‘create’)
#13 C:\localhost\htdocs\yii\framework\web\CWebApplication.php(121): CWebApplication->runController(‘tblproject/crea…’)
#14 C:\localhost\htdocs\yii\framework\base\CApplication.php(135): CWebApplication->processRequest()
#15 C:\localhost\htdocs\trackstar\index.php(13): CApplication->run()
#16 {main}
2010-10-05 20:00:45 Apache/2.2.16 (Win32) PHP/5.3.3 Yii Framework/1.1.4
any help would be much appreciated.