어떻게이 쿼리를 활성 레코드로 변환 할 수 있습니까? 어떻게 어디 clausa 상태를 사용하는 방법에 대한multiple where 조건 codeigniter
$data = array('email' => $email, 'last_ip' => $ip);
$this->db->where('username',$username);
$this->db->update('table_user',$data);
:
"UPDATE table_user
SET email = '$email', last_ip = '$last_ip'
where username = '$username' and status = '$status'";
나는 위의 쿼리를 변환하려고?
$this->db->where('username',$username,'status',$status);
비록 이것이 이것을 달성하는 하나의 방법입니다. 키 배열을 사용하는 것이 훨씬 쉽습니다. – gorelative
일부 조건을 평가 한 후 where 절을 확장해야 할 수도 있으므로 알아두면 유용합니다. – AndFisher