title: Check number of affected rows in CodeIgniter
body: <p>I am trying to check in my model method if there was affected any rows if so return true else return false, but I don't know how to get it?:</p>
  
  <pre><code>class User_model extends CI_Model {
  
      function __construct()
      {
          parent::__construct();
      }
  
      function save_new_user ($name, $email, $password)
      {
          $data = array(
              'name' =&gt; $name,
              'email' =&gt; $email,
              'password' =&gt; $password,
              'time' =&gt; time()
          );
  
          $this-&gt;db-&gt;insert('users', $data);
  
          // if (affected rows &gt; 0) return true else return false
          if ([AFFECTED_ROWS] &gt; 0) return true;
          else return false;
      }
  
  }
  </code></pre>