Codeigniter $this->db->affected_rows() always returns 1

Codeigniter $this->db->affected_rows() always returns 1
Deepak Sharma
Asked 24-11-2024
270

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.
Ankur Rajput
Asked 16-09-2018
45 Likes
Comments
Write comment

Submit your answer