Hi,
I’m quite new to Yii, and until now I didn’t have to post anything because I could manage my problems by myself, however, I falled into a strange problem after upgrade to the newest version. I just can’t add new records. The old version works fine, but I wish my Yii framework was up to date
Here is the log:
Description
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘’ for column ‘col3’ at row 1
Source File
D:\Internet\www\Apache\htdocs\yii-1.1.2.r2086\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.
I know this error comes from MySQL server that works in a strict mode, but Yii 1.1.2 works fine with it.
Any ideas?