ThinkPHP 判断更新是否成功

2014-05-22 00:35
    $Model = D('Blog');
    $data['id'] = 10;
    $data['name'] = 'update name';
    $result = $Model->save($data);
    if ( false !== $result ){
        $this->success('更新成功!');
    }else{
        $this->error('更新失败!');
    }
^