title: How to make PHP html table have color mismatch between rows?
body: <p>I am learning PHP as I code. From an example on w3schools it showed using PHP and msql to display database results on a html table. My questions is, I now have too many rows and I could not make them have mismatch colors between rows. I've tried adding style span and font color after <code>&lt;td</code> but it doesn't take it. the entire PHP just don't work if I do so. </p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","peter","abc123");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("my_db", $con);
  
  $result = mysql_query("SELECT * FROM Persons");
  
  echo "&lt;table border='1'&gt;
  &lt;tr&gt;
  &lt;th&gt;Firstname&lt;/th&gt;
  &lt;th&gt;Lastname&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($row = mysql_fetch_array($result))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['FirstName'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['LastName'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  
  mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>The output of the code above will be:</p>
  
  <pre><code>Firstname   Lastname
  Glenn   Quagmire
  Peter   Griffin
  </code></pre>
  
  <p><a href="http://www.w3schools.com/php/php_mysql_select.asp" rel="nofollow noreferrer">http://www.w3schools.com/php/php_mysql_select.asp</a></p>