Codeigniter $this->db->affected_rows() always returns 1
Answer (1)
Use this Sample code :
$update = array(
'advance_paid' => $data['TXNAMOUNT'],
'payment_mode' => 'PONLINE',
'txn_id' => $data['BANKTXNID']
);
$this->db->where("id",$data['Id']);
$query = $this->db->update("payment_table",$update);
if($this->db->affected_rows()){
return true;
}else{
return false;
}
Yes $this->db->affected_rows() always returns TRUE in CodeIgniter.