title: Grouping records from MySql
body: <p>I've got two tables in MySql</p>
  
  <blockquote>
    <p>1 (Staff): Id/Name/SecondName </p>
    
    <p>2 (fee):
    Id/StaffId/Date(yyyy-mm-dd)/HoursWorked(hh:mm)/fee(int)/workType</p>
  </blockquote>
  
  <p>There is also a script adding records to fee table. </p>
  
  <p>I'm trying to group data in php to create html table like:</p>
  
  <pre><code>Name, Second Name | January 2009 | 123:45 hours | 2100,00 USD
  February 2009...
  March 2009 ....
  Next person... etc.
  </code></pre>
  
  <p>So generally I'm trying to sum fee and hours in specific month and print a report from database... </p>
  
  <p>And I need some advice/help... What is the bast way to create table like this?</p>