codeigniter check affected rows

PHP
return $this->db->affected_rows() > 0;
Source

Also in PHP: