timster - 1:37 pm on Mar 4, 2011 (gmt 0)
This is best done in your PHP code that displays the page. It's purely about presentation, so it doesn't belong in the database logic.
Something like this would work:
1 Create varaibles for curent month heading and set to empty string.
2 For each row in the database.
3 Get the row data.
4 If the month selected from the row differs from the current month heading, generate a new month heading, and set the current month heading to the new value.
5 Output the row data.
6 Proceed to next row in database.