CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column 'stg_value', table 'limedev.dbo.test_settings_global'; column does not allow nulls. UPDATE fails.. The SQL statement executed was: UPDATE [dbo].[test_settings_global] SET [stg_name]=:yp0, [stg_value]=:yp1 WHERE [dbo].[test_settings_global].[stg_name]='emailsmtpssl'

C:\etc\Apache\htdocs\test\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
+
 C:\etc\Apache\htdocs\test\application\helpers\globalsettings_helper.php(79): CActiveRecord->save()
74     }
75 
76     if ($record = Settings_global::model()->findByPk($settingname))
77     {
78         $record->stg_value = $settingvalue;
79         $record->save();
80     }
81     else
82     {
83         $record = new Settings_global;
84         $record->stg_name = $settingname;
#4
+
 C:\etc\Apache\htdocs\test\application\controllers\admin\globalsettings.php(142): setGlobalSetting("emailsmtpssl", null)
137         setGlobalSetting('bounceencryption', strip_tags(returnGlobal('bounceencryption')));
138         setGlobalSetting('bounceaccountuser', strip_tags(returnGlobal('bounceaccountuser')));
139 
140         if (returnGlobal('bounceaccountpass') != 'enteredpassword') setGlobalSetting('bounceaccountpass', strip_tags(returnGlobal('bounceaccountpass')));
141         
142         setGlobalSetting('emailsmtpssl', sanitize_paranoid_string(returnGlobal('emailsmtpssl')));
143         setGlobalSetting('emailsmtpdebug', sanitize_int(returnGlobal('emailsmtpdebug')));
144         setGlobalSetting('emailsmtpuser', strip_tags(returnGlobal('emailsmtpuser')));
145         setGlobalSetting('filterxsshtml', strip_tags($_POST['filterxsshtml']));
146         setGlobalSetting('siteadminbounce', strip_tags($_POST['siteadminbounce']));
147         setGlobalSetting('siteadminemail', strip_tags($_POST['siteadminemail']));
#5
+
 C:\etc\Apache\htdocs\test\application\controllers\admin\globalsettings.php(44): GlobalSettings->_saveSettings()
39     * @return void
40     */
41     public function index()
42     {
43         if (!empty($_POST['action'])) {
44             $this->_saveSettings();
45         }
46         $this->_displaySettings();
47     }
48 
49     public function showphpinfo()
2012-10-19 09:11:24 Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 Yii Framework/1.1.10