title: CodeIgniter 4 Models->find()
body: <p>i'm so sorry if this question already asked before,</p>
  <p>so what i'm trying to do is to get result like this from my models</p>
  <pre><code>$data = $userModel-&gt;where('username', 'myname')-&gt;find();
  </code></pre>
  <p>my expectation :</p>
  <pre><code>$data = [
    'id' =&gt; 1,
    'username' =&gt; 'myname',
    'fullname' =&gt; 'my full name',
  ]
  </code></pre>
  <p>what i get :</p>
  <pre><code>$data = [
    0 =&gt; [
      'id' =&gt; 1,
      'username' =&gt; 'myname',
      'fullname' =&gt; 'my full name',
    ]
  ]
  </code></pre>
  <p>from the <a href="https://codeigniter4.github.io/userguide/models/model.html#finding-data" rel="nofollow noreferrer">docs here</a>, it does return a single row as result, but when i want to use the value of the array, i need to type it like this :</p>
  <pre><code>$data[0]['username']
  </code></pre>
  <p>instead of like this :</p>
  <pre><code>$data['username']
  </code></pre>
  <p>it does work as intended when i do it like this without the 'where' condition :</p>
  <pre><code>$data = $userModel-&gt;find(1);
  </code></pre>
  <p>but the problem arise when i want to search using the 'username' value instead.
  then i tried it like this and of course it doesn't work (return null) :</p>
  <pre><code>$data = $userModel-&gt;find('username', 'myname');
  </code></pre>
  <p>any pointer would be much apreciated, thank you.</p>