title: php MySQL fetch printing double?
body: <p>When I make a sql query and echo it out it repeats the first row twice</p>
  
  <pre><code>$sql = 'SELECT one,two,three FROM justAnExampleForSO where one = one';
  $info = mysql_query(sql);
  
  if(mysql_num_rows($info )&gt;0){
  
  
      while ($row = mysql_fetch_array($info )) {
  
              foreach($row as $key =&gt; $var)
              {
                  if($key == 'one')
                      echo $var.",";                    
                  else if($key == 'two')
                      echo $var.",";
                  else if($key == 'three')
                      echo $var.";";
              }           
  
          }
  
      }
  </code></pre>
  
  <p>so for example say I am attempting to get cols one, two, three
  When the output is echoed it would echo</p>
  
  <pre><code>one, one, two,three;
  </code></pre>
  
  <p>I am not sure if this is a duplicate of this question or not because I couldn't full understand his problem. <a href="https://stackoverflow.com/questions/12921939/fetch-array-function-doubling-values-in-each-position-of-array">Fetch array function doubling values in each position of array?</a></p>