获得Yii 1.0框架 Active Record 中的错误
{Boy Said}
What about when you called $arClass->save(), then nothing insert into DB, no error show? We can call a property of AR to show the error messages, then we know what's wrong.
{Code}
//record Reequtaion $newReEquation = new Reequation(); $newReEquation->uid = Yii::app()->user->id; $newReEquation->first = $newEquation->first; $newReEquation->operator = $newEquation->operator; $newReEquation->second = $newEquation->second; $newReEquation->save();//save print_r($newReEquation->errors); //display error messages after save()
留言
Elbergon
2015-03-15 00:26:08Wow, that's a really clever way of thinnikg about it!