title: How to put a break in the output when specific values change using mysqli php
body: <p>I am building a website to list statistics for bowling tournaments over the last 24 years.  Using the following code generates a long, single table showing all the data.  I would like to put a break in the table when the $row['season'] value changes, i.e., from 1990-1991 to 1991-1992, and for each subsequent change of seasons and echo either an html horizontal line between seasons or put the value of the season from the database, i.e., 2013-2014 at the top of each table segment. After a week of searching the web haven't figured out an answer.  Here's the code I have now.  Needs to be mysqli.</p>
  
  <pre><code>$result = mysqli_query($conn,"SELECT * FROM members INNER JOIN scores ON members.id=scores.memberID WHERE format LIKE '%s%' ORDER BY year, STR_TO_DATE( month, '%b' ), format ASC;");
  
  echo "&lt;table border='0'&gt;
  &lt;tr&gt;
  &lt;th&gt;Name&lt;/th&gt;
  &lt;th&gt;Hometown&lt;/th&gt;
  &lt;th&gt;Month&lt;/th&gt;
  &lt;th&gt;Year&lt;/th&gt;
  &lt;th&gt;Season&lt;/th&gt;
  &lt;th&gt;Center&lt;/th&gt;
  &lt;th&gt;Center City&lt;/th&gt;
  &lt;th&gt;Format&lt;/th&gt;
  &lt;/tr&gt;";
  
  foreach($result as $row) {
  
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['firstName'] . " ". $row['lastName'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['hometown'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['month'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['year'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['season'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['center'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['centerCity'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['format'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
  }
  
  echo "&lt;/table&gt;";
  
  mysqli_close($conn);
  </code></pre>