$jailog = new Jailog;
foreach($hosts as $host) {
$jailog->ip = $host->host_ip;
$jailog->hostname = $host->host_name;
$jailog->mac = $host->eth0_mac;
$jailog->applicant = Yii::app()->user->name;
$jailog->status = "pending";
if($jailog->validate()){
$ret = $jailog->save();
var_dump($ret);
}else {
echo CHtml::errorSummary($jailog);
}
}
页面显示save()返回true,没有错误信息
但是数据没有插入到数据库中,
mysql> select * from jailog;
Empty set (0.00 sec)
请问这是怎么回事?