how to get the mysql columns names including the right result values in one loop
<p>I ask in connection to this article:
<a href="https://stackoverflow.com/questions/1853094/how-to-get-the-columns-names-along-with-resultset-in-php-mysql">How to get the columns names along with resultset in php/mysql?</a></p>

<pre><code>$selecttable = mysql_query("SELECT * FROM $tablename WHERE (preis_bis &lt;= '$price_upper' AND preis_bis &gt; '$price_lower') LIMIT 1");
for ($i = 0; $i &lt; mysql_num_fields($selecttable); $i++) {
  $field_info = mysql_fetch_field($selecttable, $i);

  // not WORKING
  while($rowvalue = mysql_fetch_row($selecttable)) {
    echo "&lt;tr&gt;&lt;td&gt;Price: ".$rowvalue[$i]."&lt;/td&gt;&lt;/tr&gt;";
  }

  echo "&lt;tr&gt;&lt;td style='border:1px solid #c0c0c0;padding:10px;'&gt;&lt;!-- {$field_info-&gt;name} --&gt;";
  // get Logo and provider name
  $select_getlogo = mysql_query("SELECT * FROM rrv_anbieter WHERE aid = '$field_info-&gt;name' LIMIT 1");
  while($row_logo = mysql_fetch_object($select_getlogo)){
    echo $row_logo-&gt;name.'&lt;br&gt;&lt;img src="images/'.$row_logo-&gt;logo.'" style="max-width: 200px;"&gt;';
  }      
  #while($rowvalues2 = mysql_fetch_row($selecttable)) {        
  #  foreach($rowvalues2 as $_column) {
  #    echo "&lt;td&gt;{$_column}&lt;/td&gt;";
  #  }      
  #}      
  echo "&lt;/td&gt;&lt;/tr&gt;";       
}
</code></pre>

<p>I do not get it to get the correct row value within the "for" loop. Writing col names is working, but showing additionally the right value in same loop not.</p>

<p>Can someone help?</p>