public function update(){
$model = M('User')->find(I('id'));
$this->assign('model',$model);
$this->display();
if(isset($_POST['id'])){
$data['username'] = $_POST['username'];
$data['password'] = $_POST['password'];
$result=$model->where('id='.$_POST['id'])->save($data);
if($result){
$this->success("用户信息更新成功", U('Yonghu/yonghu'));
}
else{
$this->error("更新失败");
}
}
}
你看你哪个model什么呢?是个查询语句啊!