title: Codeigniter 4 - how to get the first row and the last row of a result
body: <p>I am trying to get the first row and the last row of a query result.  I see from Ci4's docs, there are two methods to help, namley, <code>getFirstRow([$type = 'object'])</code> and <code>getLastRow([$type = 'object'])</code> but I am having difficulty using them.  Here is my method so far:</p>
  <pre><code>function getLoginFailCount($login_fail_ip, $max_login_attempts = 3, $within_seconds = 320){
      $builder = $this-&gt;builder('login_fail');
      $builder-&gt;where('login_fail_ip', $login_fail_ip);
      $builder-&gt;orderBy('login_fail_created_at','DESC');
      $query = $builder-&gt;get(3);
      print_r($query-&gt;getFirstRow($query));
  }
  </code></pre>
  <p>I get an error at getFirstRow as follows;</p>
  <pre><code>Argument 1 passed to CodeIgniter\Database\BaseResult::getFirstRow() must be 
  of the type string, object given
  </code></pre>
  <p>How can I get <code>getFirstRow()</code> to work?  Doesn't this doc definition say I need to pass it an <code>object</code>?  Why does the error say it my be of type <code>string</code></p>