title: Alternating color rows in PHP loop
body: <p>How can I have an alternating color rows in my php loop?</p>
  
  <pre><code>$num = mysql_num_rows($qPhysician);
  
  $i=0;
  
  while($i &lt; $num)
  
  {
  
      echo "&lt;tr&gt;";
      echo "&lt;td&gt;" . mysql_result($qPhysician,$i,"lastName") . "&lt;/td&gt;";
      echo "&lt;td&gt;" . mysql_result($qPhysician,$i,"firstName") . "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
  
      $i++;
  
  }
  </code></pre>
  
  <p>I have to omit the "&lt;" and ">" for both "tr" and "td" because it wasn't allowed in this question. :)</p>
  
  <p>thanks!</p>