title: removing item from result query in codeigniter
body: <p>I can't remove an item from query result array in php + codeigniter.</p>
  
  <p>This is my code</p>
  
  <pre><code>if($query-&gt;num_rows &gt; 0)
      {
      $rows = $query-&gt;result();
          foreach ($rows as $key =&gt; $row)
          {
              $i = 0;
              $fornecedor = $row-&gt;fornecedor;
              $marca = $row-&gt;marca;
              $modelo = $row-&gt;modelo;
              $versao = $row-&gt;versao;
              $preco = $row-&gt;preco;
  
                  foreach ($rows as $row2)
                  {
                      $fornecedor2 = $row2-&gt;fornecedor;
                      $marca2 = $row2-&gt;marca;
                      $modelo2 = $row2-&gt;modelo;
                      $versao2 = $row2-&gt;versao;
                      $preco2 = $row2-&gt;preco;
  
                      if(($fornecedor == $fornecedor2) &amp;&amp; ($marca == $marca2) &amp;&amp; ($modelo == $modelo2) &amp;&amp; ($versao == $versao2) &amp;&amp; ($preco == $preco2))
                      {
                          $i++;
                      }
                  }
  
              if($i &gt; 3)
              {
                  unset($row[$key]);
              }
          }
          return $query;
      }
  </code></pre>
  
  <p>I already checked some examples here in stackoverflow but i cant make this work.
  I can't see the problem ty</p>