title: Handling while loop and grouping MYSQL PHP Values
body: <p>I have a table like this.</p>
  
  <pre><code>    author_id   author_book     rating  
      1           ABC             5
      1           DEF             6
      2           PPP             8
      3           FFF             9
  </code></pre>
  
  <p>Here is my PHP Code</p>
  
  <pre><code>    &lt;table&gt;
      &lt;tr&gt;&lt;td&gt;Author ID&lt;/td&gt;&lt;td&gt;Author Book&lt;/td&gt;&lt;td&gt;Rating&lt;/td&gt;&lt;/tr&gt;
      &lt;?php
      $row_data = mysql_query("select * from author_master" );
      while($row = mysql_fetch_array($row_data) ) {
      ?&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $row['author_id']; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $row['author_book']; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $row['rating']; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php } ?&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>What I would like to do is group the similar author in the same row. </p>
  
  <p>The output should look like this</p>
  
  <pre><code>    Author ID               Author Book         Rating
      1                       ABC                 5
                              DEF                 6
  
      2                       PPP                 8
  
      3                       FFF                 9                       
  </code></pre>