wielokrotność gdzie warunek kodigniter

Jak mogę przekonwertować to zapytanie na aktywny rekord?

<code>"UPDATE table_user 
 SET email = '$email', last_ip = '$last_ip' 
 where username = '$username' and status = '$status'";
</code>

Próbowałem przekonwertować powyższe zapytanie na:

<code>$data = array('email' => $email, 'last_ip' => $ip);
$this->db->where('username',$username);
$this->db->update('table_user',$data);
</code>

Co powiesz na używanie statusu where clausa?

<code># must i write db->where two times like this?
$this->db->where('username',$username);
$this->db->where('status',$status);
</code>

Próbowałem również tego:

<code>$this->db->where('username',$username,'status',$status);
</code>

questionAnswers(7)

yourAnswerToTheQuestion