zoukankan      html  css  js  c++  java
  • TP3更新头像涉及到session缓存的问题

    {
    
            $map['id']=I('post.id');//获取id   
            //获取id-用来关联留言数据表中数据保持数据的一致性
            $data_m['nick']=$data['nick'];
            $map_m['uid']=I('post.id');
            $res=$this->person_model->where($map)->save($data);
            $res_m=$this->message_model->where($map_m)->save($data_m);//保持message和person表保持一致
            if($res){
                        if($res_m)
                       
                            $this->success("修改成功,正在跳转...",U('/Index/index'));
                            }else{
                        	$this->error("修改失败,正在跳转...1");
    		          }
            }else{
                     $this->error("修改失败,正在跳转...2");
            }
    
    

    在此基础上修改session缓存的问题

    
     $map['id']=I('post.id');//获取id   
            //获取id-用来关联留言数据表中数据保持数据的一致性
            $data_m['nick']=$data['nick'];
            $map_m['uid']=I('post.id');
            $res=$this->person_model->where($map)->save($data);
            $res_m=$this->message_model->where($map_m)->save($data_m);//保持message和person表保持一致
            if($res){
                            $user=$this->person_model->where($map)->find();  
                            session('user', null);
                            session('user', $user);//校验成功存入session中
                            $this->success("修改成功,正在跳转...",U('/Index/index'));
            }else{
                     $this->error("修改失败,正在跳转...2");
            }
    
    
  • 相关阅读:
    设计模式开始--工厂模式
    设计模式开始--UML类之间关系表示
    设计模式开始1--不明觉厉
    Gas Station
    Validate Binary Search Tree
    Word Ladder
    (转)基于快速排序的TOPK算法
    Number of 1 Bits
    Word Search
    Rotate Array
  • 原文地址:https://www.cnblogs.com/hiszm/p/12384983.html
Copyright © 2011-2022 走看看