如何将此查询转换为活动记录?
"UPDATE table_user
SET email = '$email', last_ip = '$last_ip'
where username = '$username' and status = '$status'";
我试图将上面的查询转换为:
$data = array('email' => $email, 'last_ip' => $ip);
$this->db->where('username',$username);
$this->db->update('table_user',$data);
如何使用 where 子句状态?
# must i write db->where two times like this?
$this->db->where('username',$username);
$this->db->where('status',$status);
我也试过这个:
$this->db->where('username',$username,'status',$status);