title: Using foreach loop with Query Builder in Yii 2
body: <p>For some reason this isn't working. The error I get is "Undefined index: cu_id" for the line</p>
  
  <pre><code>$cu_id = $rows['cu_id'];
  </code></pre>
  
  <p>I think I'm just totally using the querybuilder wrong with the foreach loop. Any help with the proper syntax for this? Thanks!</p>
  
  <pre><code>$query = new Query;
  
              $query-&gt;select('cu_id')-&gt;from('cu_emails')-&gt;where(['creator_id' =&gt; $user_id, 'email' =&gt; $email]);
  
  
      foreach ($query as $rows) {
  
              $cu_id = $rows['cu_id'];
  
              echo"CU ID: $cu_id&lt;br /&gt;&lt;br /&gt;";
  
      }
  </code></pre>
  
  <p>Also I'm on the Yii 2 framework in case anyone missed that.</p>