Codeigniter database update
- by Carry All
The table is like this
and I want to update DecryptionDate by specify ArchiveID and RecipientID
this is my code
$this->load->database();
$date = date("Y-m-d H:i:s");
$data = array('DecryptionDate' => $date);
$array = array('ArchiveID'=>$archiveID.'','RecipientID'=>$userID.'');
$this->db->where($array);
$this->db->update('log', $data);
if ($this->db->affected_rows() > 0) {
echo "SUCCESS";
} else {
echo "FAIL";
}
my problem is I can update the data only when $archiveID is 911 and $userID is test01 but the program fail to update when $archiveID is 911 and $userID is test02