multiple where condition codeigniter

前端 未结 7 1045
感情败类
感情败类 2021-02-01 15:16

How can I convert this query to active record?

\"UPDATE table_user 
 SET email = \'$email\', last_ip = \'$last_ip\' 
 where username = \'$username\' and status =         


        
7条回答
  •  醉梦人生
    2021-02-01 15:53

    Try this

    $data = array(
                   'email' =>$email,
                   'last_ip' => $last_ip
                );
    
    $where = array('username ' => $username , 'status ' => $status);
    $this->db->where($where);
    $this->db->update('table_user ', $data); 
    

提交回复
热议问题