title: ODBC while and foreach loop outputs 2 results in php
body: <p>I have selected Top 5 rows in my database and used ODBC as a connection instead of the natural way of MSSQL connecting. Every time I refresh my page where the while and foreach loop contain, it gives 2 outputs instead of one. Can you help me guys with with</p>
  
  <p>Here's my entire code</p>
  
  <pre><code>&lt;?php
              $que = "SELECT top 5 notification FROM notification order by datetime desc";
              $queresa = odbc_exec($conn,$que);
              $rows = array();
  
              while($myRow = odbc_fetch_array( $queresa )){ 
                   $rows[] = $myRow;
                     foreach($rows as $row) {
                        foreach($row as $key =&gt; $value) {
                             $result = $value;
                             echo "&lt;a href='#' class='list-group-item'&gt;
                                     &lt;i class='fa fa-envelope fa-fw'&gt;&lt;/i&gt;&lt;font color='green'&gt;$result&lt;/font&gt;
                                  &lt;/a&gt;";
                        }
                     }
              }
  ?&gt;
  </code></pre>