ser0632 2012-06-08 10:05:10 4282次浏览 3条回复 0 0 0

之前有几个字段是数值,后来我在数据库改为字符,我在MOdel里也改成 array('STUDYID', 'length', 'max'=>30), 可结果YII把报错,报错信息如下: CDbException 列名必须是一个字符串或者数组

D:\web_root\rd1039b\framework\db\schema\CDbCommandBuilder.php(701)

689             }
690             if(count($values)===1)
691             {
692                 $entries=array();
693                 foreach($values[0] as $name=>$value)
694                     $entries[]=$prefix.$table->columns[$name]->rawName.($value===null?' IS NULL':'='.$value);
695                 return implode(' AND ',$entries);
696             }
697 
698             return $this->createCompositeInCondition($table,$values,$prefix);
699         }
700         else
[color=Red]701             throw new CDbException(Yii::t('yii','Column name must be either a string or an array.'));[/color]702     }


+– D:\web_root\rd1039b\www\protected\controllers\Mh1Controller.php(254): CActiveRecord->save() 
249             }
250             
251                 
252                 if (Yii::app()->user->ROLE==STUDY_USER_ROLE_PI){
253                     $model->ENTRY2WHO= Yii::app()->user->USERNAME;
[color=Red]254                         if ($model-> save())[/color]
255                         {
256                             if($SORT!=3){
257                             $this->ToDo($Name,$MH1,$keyid);
258                             }
259                             else

高手,这是怎么回事呀?请帮忙

您需要登录后才可以回复。登录 | 立即注册