Tutorialsplane

Codeigniter get affected rows delete example


Codeigniter get affected rows delete example : $this->db->affected_rows(); is used to get affected rows in codeigniter.

Codeigniter get affected rows delete example

$where_array = array(
                'id'=>$id
            );

$this->db->delete('table_name', $where_array);
$affected_rows = $this->db->affected_rows();