Codeigniter database update
Posted
by
Carry All
on Stack Overflow
See other posts from Stack Overflow
or by Carry All
Published on 2011-11-16T09:49:09Z
Indexed on
2011/11/16
9:50 UTC
Read the original article
Hit count: 238
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
© Stack Overflow or respective owner